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 class
ANamedReference
that references a field or column.static final class
ANamedReference
that 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.FieldReference
for the given column name.Returns aNamedReference.FieldReference
for the given field name(s).String[]
Returns the referenced field name as an array of String parts.static NamedReference.MetadataField
metadataField
(String[] fieldNames) Returns aNamedReference.MetadataField
for the given field name(s).default NamedReference[]
-
Method Details
-
field
Returns aNamedReference.FieldReference
for 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.FieldReference
for the given field name(s)
-
field
Returns aNamedReference.FieldReference
for the given column name.- Parameters:
columnName
- the column name- Returns:
- a
NamedReference.FieldReference
for the given column name.
-
metadataField
Returns aNamedReference.MetadataField
for 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.MetadataField
for 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:
children
in interfaceExpression
- Returns:
- An array of the children of this node. Children should not change.
-
references
- Specified by:
references
in interfaceExpression
- Returns:
- A list of fields or columns that are referenced by this expression.
-