Record Class SchemaNode.GroupNode

java.lang.Object
java.lang.Record
dev.hardwood.schema.SchemaNode.GroupNode
Record Components:
name - field name
repetitionType - whether the group is required, optional, or repeated
convertedType - legacy annotation indicating list, map, or map-key-value semantics, or null for plain structs
logicalType - modern logical-type annotation applied to the group (e.g. LogicalType.VariantType), or null if unannotated
children - child nodes of this group
maxDefinitionLevel - maximum definition level
maxRepetitionLevel - 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.
  • Constructor Details

  • 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 the LogicalType.VariantType annotation.
    • getListElement

      public SchemaNode getListElement()

      For LIST groups, returns the element node (skipping the intermediate list/key_value group in standard 3-level encoding). Returns null if 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:

      1. If the repeated field is not a group, the repeated field's type is the element type.
      2. If the repeated field is a group with multiple fields, the repeated group is the element.
      3. If the repeated field is a group with one field and is named either array or uses the LIST-annotated group's name with _tuple appended, the repeated group is the element.
      4. Otherwise, the repeated field's single child is the element (standard 3-level encoding).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface SchemaNode
      Returns:
      the value of the name record component
    • repetitionType

      public RepetitionType repetitionType()
      Returns the value of the repetitionType record component.
      Specified by:
      repetitionType in interface SchemaNode
      Returns:
      the value of the repetitionType record component
    • convertedType

      public ConvertedType convertedType()
      Returns the value of the convertedType record component.
      Returns:
      the value of the convertedType record component
    • logicalType

      public LogicalType logicalType()
      Returns the value of the logicalType record component.
      Returns:
      the value of the logicalType record component
    • children

      public List<SchemaNode> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component
    • maxDefinitionLevel

      public int maxDefinitionLevel()
      Returns the value of the maxDefinitionLevel record component.
      Specified by:
      maxDefinitionLevel in interface SchemaNode
      Returns:
      the value of the maxDefinitionLevel record component
    • maxRepetitionLevel

      public int maxRepetitionLevel()
      Returns the value of the maxRepetitionLevel record component.
      Specified by:
      maxRepetitionLevel in interface SchemaNode
      Returns:
      the value of the maxRepetitionLevel record component