Record Class SchemaNode.PrimitiveNode

java.lang.Object
java.lang.Record
dev.hardwood.schema.SchemaNode.PrimitiveNode
Record Components:
column - the leaf's column
All Implemented Interfaces:
SchemaNode
Enclosing interface:
SchemaNode

public static record SchemaNode.PrimitiveNode(ColumnSchema column) extends Record implements SchemaNode

Primitive leaf node representing an actual data column.

The node holds the leaf's entry in the flat column list, FileSchema.getColumns(), and reads each of its attributes from that entry.

  • Constructor Details

    • PrimitiveNode

      public PrimitiveNode(ColumnSchema column)
      Creates an instance of a PrimitiveNode record class.
      Parameters:
      column - the value for the column record component
  • Method Details

    • name

      public String name()
      Returns the field name.
      Specified by:
      name in interface SchemaNode
    • type

      public PhysicalType type()
      Returns the physical (storage) type.
    • repetitionType

      public RepetitionType repetitionType()
      Returns whether the field is required, optional, or repeated.
      Specified by:
      repetitionType in interface SchemaNode
    • typeLength

      public Integer typeLength()
      Returns the fixed byte length of a PhysicalType.FIXED_LEN_BYTE_ARRAY field, or null for any other type.
    • logicalType

      public LogicalType logicalType()
      Returns the logical type annotation, or null if absent.
    • columnIndex

      public int columnIndex()
      Returns the zero-based index among all leaf columns.
    • maxDefinitionLevel

      public int maxDefinitionLevel()
      Description copied from interface: SchemaNode
      Returns the maximum definition level, computed from the schema hierarchy.
      Specified by:
      maxDefinitionLevel in interface SchemaNode
    • maxRepetitionLevel

      public int maxRepetitionLevel()
      Description copied from interface: SchemaNode
      Returns the maximum repetition level, computed from the schema hierarchy.
      Specified by:
      maxRepetitionLevel in interface SchemaNode
    • fieldId

      public Integer fieldId()
      Description copied from interface: SchemaNode
      Returns the field id of the schema element (field_id in parquet.thrift), or null if the element has no field id.
      Specified by:
      fieldId in interface SchemaNode
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • column

      public ColumnSchema column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component