Package org.apache.druid.segment.column
Class RowSignature
java.lang.Object
org.apache.druid.segment.column.RowSignature
- All Implemented Interfaces:
Expr.InputBindingInspector,ColumnInspector
Type signature for a row in a Druid datasource or query result.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionstatic RowSignature.Builderbuilder()buildSafeSignature(List<String> requestedColumnNames) Builds a safeRowSignature.booleancontains(int columnNumber) booleanReturns whether this signature contains a named column.static RowSignatureempty()booleangetColumnCapabilities(String column) Returns capabilities of a particular column.getColumnName(int columnNumber) Returns the name of the column at positioncolumnNumber.Returns a list of column names in the order they appear in this signature.getColumnType(int columnNumber) Returns the type of the column at positioncolumnNumber, or empty if the type is unknown.getColumnType(String columnName) Returns the type of the column namedcolumnName, or empty if the type is unknown or the column does not exist.Returns the column types in the order they are in.inthashCode()intReturns the first position ofcolumnNamein this row signature, or -1 if it does not appear.booleanReturns true if the column is a numeric type (TypeSignature.isNumeric()), otherwise false if the column is not a numeric type or is not present in the row signature.intsize()Returns the number of columns in this signature.toString()withPrefix(String prefix) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.segment.ColumnInspector
getTypeMethods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
Method Details
-
builder
-
empty
-
getColumnName
Returns the name of the column at positioncolumnNumber.- Throws:
IndexOutOfBoundsException- if columnNumber is not within our row length
-
getColumnType
Returns the type of the column namedcolumnName, or empty if the type is unknown or the column does not exist. -
getColumnType
Returns the type of the column at positioncolumnNumber, or empty if the type is unknown.- Throws:
IndexOutOfBoundsException- if columnNumber is not within our row length
-
isNumeric
Returns true if the column is a numeric type (TypeSignature.isNumeric()), otherwise false if the column is not a numeric type or is not present in the row signature. -
getColumnNames
Returns a list of column names in the order they appear in this signature. -
size
public int size()Returns the number of columns in this signature. -
contains
Returns whether this signature contains a named column. -
contains
public boolean contains(int columnNumber) -
indexOf
Returns the first position ofcolumnNamein this row signature, or -1 if it does not appear. Note: the same column name may appear more than once in a signature; if it does, this method will return the first appearance. -
equals
-
hashCode
public int hashCode() -
toString
-
getColumnCapabilities
Description copied from interface:ColumnInspectorReturns capabilities of a particular column.- Specified by:
getColumnCapabilitiesin interfaceColumnInspector- Parameters:
column- column name- Returns:
- capabilities, or null
-
buildSafeSignature
Builds a safeRowSignature. The new rowsignature will not contain `null` types - they will be replaced by STRING. -
getColumnTypes
Returns the column types in the order they are in. -
withPrefix
-