Record Class SchemaNode.GroupNode
java.lang.Object
java.lang.Record
dev.hardwood.schema.SchemaNode.GroupNode
- Record Components:
name- field namerepetitionType- whether the group is required, optional, or repeatedconvertedType- legacy annotation indicating list, map, or map-key-value semantics, ornullfor plain structslogicalType- modern logical-type annotation applied to the group (e.g.LogicalType.VariantType), ornullif unannotatedchildren- child nodes of this groupmaxDefinitionLevel- maximum definition levelmaxRepetitionLevel- maximum repetition level
- All Implemented Interfaces:
SchemaNode
- Enclosing interface:
SchemaNode
public static record SchemaNode.GroupNode(String name, RepetitionType repetitionType, ConvertedType convertedType, LogicalType logicalType, List<SchemaNode> children, int maxDefinitionLevel, int maxRepetitionLevel)
extends Record
implements SchemaNode
Group node representing a struct, list, map, or variant.
-
Nested Class Summary
Nested classes/interfaces inherited from interface SchemaNode
SchemaNode.GroupNode, SchemaNode.PrimitiveNode -
Constructor Summary
ConstructorsConstructorDescriptionGroupNode(String name, RepetitionType repetitionType, ConvertedType convertedType, LogicalType logicalType, List<SchemaNode> children, int maxDefinitionLevel, int maxRepetitionLevel) Creates an instance of aGroupNoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionchildren()Returns the value of thechildrenrecord component.Returns the value of theconvertedTyperecord component.final booleanIndicates whether some other object is "equal to" this one.For LIST groups, returns the element node (skipping the intermediatelist/key_valuegroup in standard 3-level encoding).final inthashCode()Returns a hash code value for this object.booleanisList()Returns true if this is a LIST group.booleanisMap()Returns true if this is a MAP group.booleanisStruct()Returns true if this is a plain struct (no converted type and no modern logical-type annotation).booleanReturns true if this group carries theLogicalType.VariantTypeannotation.Returns the value of thelogicalTyperecord component.intReturns the value of themaxDefinitionLevelrecord component.intReturns the value of themaxRepetitionLevelrecord component.name()Returns the value of thenamerecord component.Returns the value of therepetitionTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GroupNode
public GroupNode(String name, RepetitionType repetitionType, ConvertedType convertedType, LogicalType logicalType, List<SchemaNode> children, int maxDefinitionLevel, int maxRepetitionLevel) Creates an instance of aGroupNoderecord class.- Parameters:
name- the value for thenamerecord componentrepetitionType- the value for therepetitionTyperecord componentconvertedType- the value for theconvertedTyperecord componentlogicalType- the value for thelogicalTyperecord componentchildren- the value for thechildrenrecord componentmaxDefinitionLevel- the value for themaxDefinitionLevelrecord componentmaxRepetitionLevel- the value for themaxRepetitionLevelrecord component
-
-
Method Details
-
isList
public boolean isList()Returns true if this is a LIST group. -
isMap
public boolean isMap()Returns true if this is a MAP group. -
isStruct
public boolean isStruct()Returns true if this is a plain struct (no converted type and no modern logical-type annotation). -
isVariant
public boolean isVariant()Returns true if this group carries theLogicalType.VariantTypeannotation. -
getListElement
For LIST groups, returns the element node (skipping the intermediate
list/key_valuegroup in standard 3-level encoding). Returnsnullif not a list or improperly structured.Applies the Parquet backward-compatibility rules for legacy 2-level encodings as defined in the format spec; see Backward-compatibility rules:
- If the repeated field is not a group, the repeated field's type is the element type.
- If the repeated field is a group with multiple fields, the repeated group is the element.
- If the repeated field is a group with one field and is named either
arrayor uses the LIST-annotated group's name with_tupleappended, the repeated group is the element. - Otherwise, the repeated field's single child is the element (standard 3-level encoding).
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceSchemaNode- Returns:
- the value of the
namerecord component
-
repetitionType
Returns the value of therepetitionTyperecord component.- Specified by:
repetitionTypein interfaceSchemaNode- Returns:
- the value of the
repetitionTyperecord component
-
convertedType
Returns the value of theconvertedTyperecord component.- Returns:
- the value of the
convertedTyperecord component
-
logicalType
Returns the value of thelogicalTyperecord component.- Returns:
- the value of the
logicalTyperecord component
-
children
-
maxDefinitionLevel
public int maxDefinitionLevel()Returns the value of themaxDefinitionLevelrecord component.- Specified by:
maxDefinitionLevelin interfaceSchemaNode- Returns:
- the value of the
maxDefinitionLevelrecord component
-
maxRepetitionLevel
public int maxRepetitionLevel()Returns the value of themaxRepetitionLevelrecord component.- Specified by:
maxRepetitionLevelin interfaceSchemaNode- Returns:
- the value of the
maxRepetitionLevelrecord component
-