Class SchemaElement

java.lang.Object
org.apache.parquet.format.SchemaElement
All Implemented Interfaces:
Serializable, Cloneable, Comparable<SchemaElement>, org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>, org.apache.thrift.TSerializable

@Generated(value="Autogenerated by Thrift Compiler (0.23.0)", date="2026-08-06") public class SchemaElement extends Object implements org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>, Serializable, Cloneable, Comparable<SchemaElement>
Represents an element inside a schema definition. - if it is a group (inner node) then type is undefined and num_children is defined - if it is a primitive type (leaf) then type is defined and num_children is undefined the nodes are listed in depth first traversal order.
See Also:
  • Field Details

    • type

      public Type type
      Data type for this field. Not set if the current element is a non-leaf node
      See Also:
    • type_length

      public int type_length
      If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the values. Otherwise, if specified, this is the maximum bit length to store any of the values. (e.g. a low cardinality INT col could have this set to 3). Note that this is in the schema, and therefore fixed for the entire file.
    • repetition_type

      public FieldRepetitionType repetition_type
      repetition of the field. The root of the schema does not have a repetition_type. All other nodes must have one
      See Also:
    • name

      public String name
      Name of the field in the schema
    • num_children

      public int num_children
      Nested fields. Since thrift does not support nested fields, the nesting is flattened to a single list by a depth-first traversal. The children count is used to construct the nested relationship. This field is not set when the element is a primitive type
    • converted_type

      public ConvertedType converted_type
      DEPRECATED: When the schema is the result of a conversion from another model. Used to record the original type to help with cross conversion. This is superseded by logicalType.
      See Also:
    • scale

      public int scale
      DEPRECATED: Used when this column contains decimal data. See the DECIMAL converted type for more details. This is superseded by using the DecimalType annotation in logicalType.
    • precision

      public int precision
    • field_id

      public int field_id
      When the original schema supports field ids, this will save the original field id in the parquet schema
    • logicalType

      public LogicalType logicalType
      The logical type of this SchemaElement LogicalType replaces ConvertedType, but ConvertedType is still required for some logical types to ensure forward-compatibility in format v1.
    • metaDataMap

      public static final Map<SchemaElement._Fields,org.apache.thrift.meta_data.FieldMetaData> metaDataMap
  • Constructor Details

    • SchemaElement

      public SchemaElement()
    • SchemaElement

      public SchemaElement(String name)
    • SchemaElement

      public SchemaElement(SchemaElement other)
      Performs a deep copy on other.
  • Method Details

    • deepCopy

      public SchemaElement deepCopy()
      Specified by:
      deepCopy in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • clear

      public void clear()
      Specified by:
      clear in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • getType

      public Type getType()
      Data type for this field. Not set if the current element is a non-leaf node
      See Also:
    • setType

      public SchemaElement setType(Type type)
      Data type for this field. Not set if the current element is a non-leaf node
      See Also:
    • unsetType

      public void unsetType()
    • isSetType

      public boolean isSetType()
      Returns true if field type is set (has been assigned a value) and false otherwise
    • setTypeIsSet

      public void setTypeIsSet(boolean value)
    • getType_length

      public int getType_length()
      If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the values. Otherwise, if specified, this is the maximum bit length to store any of the values. (e.g. a low cardinality INT col could have this set to 3). Note that this is in the schema, and therefore fixed for the entire file.
    • setType_length

      public SchemaElement setType_length(int type_length)
      If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the values. Otherwise, if specified, this is the maximum bit length to store any of the values. (e.g. a low cardinality INT col could have this set to 3). Note that this is in the schema, and therefore fixed for the entire file.
    • unsetType_length

      public void unsetType_length()
    • isSetType_length

      public boolean isSetType_length()
      Returns true if field type_length is set (has been assigned a value) and false otherwise
    • setType_lengthIsSet

      public void setType_lengthIsSet(boolean value)
    • getRepetition_type

      public FieldRepetitionType getRepetition_type()
      repetition of the field. The root of the schema does not have a repetition_type. All other nodes must have one
      See Also:
    • setRepetition_type

      public SchemaElement setRepetition_type(FieldRepetitionType repetition_type)
      repetition of the field. The root of the schema does not have a repetition_type. All other nodes must have one
      See Also:
    • unsetRepetition_type

      public void unsetRepetition_type()
    • isSetRepetition_type

      public boolean isSetRepetition_type()
      Returns true if field repetition_type is set (has been assigned a value) and false otherwise
    • setRepetition_typeIsSet

      public void setRepetition_typeIsSet(boolean value)
    • getName

      public String getName()
      Name of the field in the schema
    • setName

      public SchemaElement setName(String name)
      Name of the field in the schema
    • unsetName

      public void unsetName()
    • isSetName

      public boolean isSetName()
      Returns true if field name is set (has been assigned a value) and false otherwise
    • setNameIsSet

      public void setNameIsSet(boolean value)
    • getNum_children

      public int getNum_children()
      Nested fields. Since thrift does not support nested fields, the nesting is flattened to a single list by a depth-first traversal. The children count is used to construct the nested relationship. This field is not set when the element is a primitive type
    • setNum_children

      public SchemaElement setNum_children(int num_children)
      Nested fields. Since thrift does not support nested fields, the nesting is flattened to a single list by a depth-first traversal. The children count is used to construct the nested relationship. This field is not set when the element is a primitive type
    • unsetNum_children

      public void unsetNum_children()
    • isSetNum_children

      public boolean isSetNum_children()
      Returns true if field num_children is set (has been assigned a value) and false otherwise
    • setNum_childrenIsSet

      public void setNum_childrenIsSet(boolean value)
    • getConverted_type

      public ConvertedType getConverted_type()
      DEPRECATED: When the schema is the result of a conversion from another model. Used to record the original type to help with cross conversion. This is superseded by logicalType.
      See Also:
    • setConverted_type

      public SchemaElement setConverted_type(ConvertedType converted_type)
      DEPRECATED: When the schema is the result of a conversion from another model. Used to record the original type to help with cross conversion. This is superseded by logicalType.
      See Also:
    • unsetConverted_type

      public void unsetConverted_type()
    • isSetConverted_type

      public boolean isSetConverted_type()
      Returns true if field converted_type is set (has been assigned a value) and false otherwise
    • setConverted_typeIsSet

      public void setConverted_typeIsSet(boolean value)
    • getScale

      public int getScale()
      DEPRECATED: Used when this column contains decimal data. See the DECIMAL converted type for more details. This is superseded by using the DecimalType annotation in logicalType.
    • setScale

      public SchemaElement setScale(int scale)
      DEPRECATED: Used when this column contains decimal data. See the DECIMAL converted type for more details. This is superseded by using the DecimalType annotation in logicalType.
    • unsetScale

      public void unsetScale()
    • isSetScale

      public boolean isSetScale()
      Returns true if field scale is set (has been assigned a value) and false otherwise
    • setScaleIsSet

      public void setScaleIsSet(boolean value)
    • getPrecision

      public int getPrecision()
    • setPrecision

      public SchemaElement setPrecision(int precision)
    • unsetPrecision

      public void unsetPrecision()
    • isSetPrecision

      public boolean isSetPrecision()
      Returns true if field precision is set (has been assigned a value) and false otherwise
    • setPrecisionIsSet

      public void setPrecisionIsSet(boolean value)
    • getField_id

      public int getField_id()
      When the original schema supports field ids, this will save the original field id in the parquet schema
    • setField_id

      public SchemaElement setField_id(int field_id)
      When the original schema supports field ids, this will save the original field id in the parquet schema
    • unsetField_id

      public void unsetField_id()
    • isSetField_id

      public boolean isSetField_id()
      Returns true if field field_id is set (has been assigned a value) and false otherwise
    • setField_idIsSet

      public void setField_idIsSet(boolean value)
    • getLogicalType

      public LogicalType getLogicalType()
      The logical type of this SchemaElement LogicalType replaces ConvertedType, but ConvertedType is still required for some logical types to ensure forward-compatibility in format v1.
    • setLogicalType

      public SchemaElement setLogicalType(LogicalType logicalType)
      The logical type of this SchemaElement LogicalType replaces ConvertedType, but ConvertedType is still required for some logical types to ensure forward-compatibility in format v1.
    • unsetLogicalType

      public void unsetLogicalType()
    • isSetLogicalType

      public boolean isSetLogicalType()
      Returns true if field logicalType is set (has been assigned a value) and false otherwise
    • setLogicalTypeIsSet

      public void setLogicalTypeIsSet(boolean value)
    • setFieldValue

      public void setFieldValue(SchemaElement._Fields field, Object value)
      Specified by:
      setFieldValue in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • getFieldValue

      public Object getFieldValue(SchemaElement._Fields field)
      Specified by:
      getFieldValue in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • isSet

      public boolean isSet(SchemaElement._Fields field)
      Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
      Specified by:
      isSet in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(SchemaElement that)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(SchemaElement other)
      Specified by:
      compareTo in interface Comparable<SchemaElement>
    • fieldForId

      public SchemaElement._Fields fieldForId(int fieldId)
      Specified by:
      fieldForId in interface org.apache.thrift.TBase<SchemaElement,SchemaElement._Fields>
    • read

      public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException
      Specified by:
      read in interface org.apache.thrift.TSerializable
      Throws:
      org.apache.thrift.TException
    • write

      public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
      Specified by:
      write in interface org.apache.thrift.TSerializable
      Throws:
      org.apache.thrift.TException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validate

      public void validate() throws org.apache.thrift.TException
      Throws:
      org.apache.thrift.TException