Interface NamedReference
- All Superinterfaces:
Expression
- All Known Implementing Classes:
FieldReferenceDTO,NamedReference.FieldReference,NamedReference.MetadataField
Represents a field or column reference in the public logical expression API.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classANamedReferencethat references a field or column.static final classANamedReferencethat references a metadata field. -
Field Summary
Fields inherited from interface org.apache.gravitino.rel.expressions.Expression
EMPTY_EXPRESSION, EMPTY_NAMED_REFERENCE -
Method Summary
Modifier and TypeMethodDescriptiondefault Expression[]children()Returns aNamedReference.FieldReferencefor the given column name.Returns aNamedReference.FieldReferencefor the given field name(s).String[]Returns the referenced field name as an array of String parts.static NamedReference.MetadataFieldmetadataField(String[] fieldNames) Returns aNamedReference.MetadataFieldfor the given field name(s).default NamedReference[]
-
Method Details
-
field
Returns aNamedReference.FieldReferencefor the given field name(s). The array of field name(s) is used to reference nested fields. For example, if we have a struct column named "student" with a data type of StructType{"name": StringType, "age": IntegerType}, we can reference the field "name" by callingfield("student", "name").- Parameters:
fieldName- the field name(s)- Returns:
- a
NamedReference.FieldReferencefor the given field name(s)
-
field
Returns aNamedReference.FieldReferencefor the given column name.- Parameters:
columnName- the column name- Returns:
- a
NamedReference.FieldReferencefor the given column name.
-
metadataField
Returns aNamedReference.MetadataFieldfor the given field name(s). The array of field name(s) is used to reference metadata fields.- Parameters:
fieldNames- the field name(s)- Returns:
- a
NamedReference.MetadataFieldfor the given field name(s)
-
fieldName
String[] fieldName()Returns the referenced field name as an array of String parts.Each string in the returned array represents a field name.
- Returns:
- the referenced field name as an array of String parts.
-
children
- Specified by:
childrenin interfaceExpression- Returns:
- An array of the children of this node. Children should not change.
-
references
- Specified by:
referencesin interfaceExpression- Returns:
- A list of fields or columns that are referenced by this expression.
-