java.lang.Object
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.properties.ParquetSchemaElement

public class ParquetSchemaElement extends Object
ParquetSchemaElement describes a field in the schema of a Parquet file. A field is either a column that holds values (called a leaf) or a group of nested fields.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return whether a time or timestamp is an instant on the UTC timeline (true) or a local time, with no time zone, (false).
    Return the name of the annotation that describes how to interpret the field, whichever style of annotation the writer used.
    Return the fields nested in this field.
    Return the original style of annotation that describes how to interpret the values (such as UTF8 or TIMESTAMP_MILLIS).
    Return a description of the type of data stored in this field, using the names of types that are familiar from programming languages and databases rather than the names of the Parquet encodings.
    Return the identifier assigned to the field by the writer.
    Return the description of the logical type annotation introduced in version 2 of the format, including its parameters, such as TIMESTAMP(MICROS, UTC).
    Return the name of the logical type annotation without its parameters, such as TIMESTAMP.
    Return the name of the field.
    Return the names of each of the fields from the top-level field to this field, separated by dots.
    Return the type used to store the values (BOOLEAN, INT32, INT64, INT96, FLOAT, DOUBLE, BYTE_ARRAY or FIXED_LEN_BYTE_ARRAY).
    Return the total number of digits in a decimal.
    Return whether the field is REQUIRED, OPTIONAL or REPEATED.
    Return the number of digits after the decimal point for a decimal.
    Return the unit (MILLIS, MICROS or NANOS) that a time or timestamp is stored in.
    Return the number of bytes in each value if the physical type is FIXED_LEN_BYTE_ARRAY.
    boolean
    Return whether this field holds values (true) or is a group of other fields (false).
    boolean
    Return whether a value can be missing for this field.
    boolean
    Return whether this field is an unsigned integer.
    void
    setAdjustedToUTC(Boolean adjustedToUTC)
    Set up whether a time or timestamp is an instant on the UTC timeline or a local time.
    void
    setConvertedType(String convertedType)
    Set up the converted type.
    void
    Set up the identifier assigned to the field by the writer.
    void
    setLogicalType(String logicalType)
    Set up the description of the logical type.
    void
    setLogicalTypeName(String logicalTypeName)
    Set up the name of the logical type.
    void
    Set up the name of the field.
    void
    setPathName(String pathName)
    Set up the dot-separated path name.
    void
    setPhysicalType(String physicalType)
    Set up the type used to store the values.
    void
    setPrecision(Integer precision)
    Set up the total number of digits in a decimal.
    void
    setRepetition(String repetition)
    Set up whether the field is REQUIRED, OPTIONAL or REPEATED.
    void
    Set up the number of digits after the decimal point for a decimal.
    void
    setTimeUnit(String timeUnit)
    Set up the unit that a time or timestamp is stored in.
    void
    setTypeLength(Integer typeLength)
    Set up the number of bytes in each value.
    Standard toString method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ParquetSchemaElement

      public ParquetSchemaElement()
      Default constructor.
  • Method Details

    • getName

      public String getName()
      Return the name of the field.
      Returns:
      string
    • setName

      public void setName(String name)
      Set up the name of the field.
      Parameters:
      name - string
    • getPathName

      public String getPathName()
      Return the names of each of the fields from the top-level field to this field, separated by dots. This is the name used to match the field to the values stored for it.
      Returns:
      string
    • setPathName

      public void setPathName(String pathName)
      Set up the dot-separated path name.
      Parameters:
      pathName - string
    • getPhysicalType

      public String getPhysicalType()
      Return the type used to store the values (BOOLEAN, INT32, INT64, INT96, FLOAT, DOUBLE, BYTE_ARRAY or FIXED_LEN_BYTE_ARRAY). It is null for a group.
      Returns:
      string
    • setPhysicalType

      public void setPhysicalType(String physicalType)
      Set up the type used to store the values.
      Parameters:
      physicalType - string
    • getTypeLength

      public Integer getTypeLength()
      Return the number of bytes in each value if the physical type is FIXED_LEN_BYTE_ARRAY.
      Returns:
      number of bytes or null
    • setTypeLength

      public void setTypeLength(Integer typeLength)
      Set up the number of bytes in each value.
      Parameters:
      typeLength - number of bytes or null
    • getRepetition

      public String getRepetition()
      Return whether the field is REQUIRED, OPTIONAL or REPEATED.
      Returns:
      string
    • setRepetition

      public void setRepetition(String repetition)
      Set up whether the field is REQUIRED, OPTIONAL or REPEATED.
      Parameters:
      repetition - string
    • isNullable

      public boolean isNullable()
      Return whether a value can be missing for this field.
      Returns:
      boolean
    • getConvertedType

      public String getConvertedType()
      Return the original style of annotation that describes how to interpret the values (such as UTF8 or TIMESTAMP_MILLIS). This is the only annotation in files written to version 1 of the format. Newer writers add it alongside the logical type, when there is an equivalent, so older readers still work.
      Returns:
      string or null
    • setConvertedType

      public void setConvertedType(String convertedType)
      Set up the converted type.
      Parameters:
      convertedType - string or null
    • getLogicalType

      public String getLogicalType()
      Return the description of the logical type annotation introduced in version 2 of the format, including its parameters, such as TIMESTAMP(MICROS, UTC).
      Returns:
      string or null
    • setLogicalType

      public void setLogicalType(String logicalType)
      Set up the description of the logical type.
      Parameters:
      logicalType - string or null
    • getLogicalTypeName

      public String getLogicalTypeName()
      Return the name of the logical type annotation without its parameters, such as TIMESTAMP.
      Returns:
      string or null
    • setLogicalTypeName

      public void setLogicalTypeName(String logicalTypeName)
      Set up the name of the logical type.
      Parameters:
      logicalTypeName - string or null
    • getScale

      public Integer getScale()
      Return the number of digits after the decimal point for a decimal.
      Returns:
      number or null
    • setScale

      public void setScale(Integer scale)
      Set up the number of digits after the decimal point for a decimal.
      Parameters:
      scale - number or null
    • getPrecision

      public Integer getPrecision()
      Return the total number of digits in a decimal.
      Returns:
      number or null
    • setPrecision

      public void setPrecision(Integer precision)
      Set up the total number of digits in a decimal.
      Parameters:
      precision - number or null
    • getFieldId

      public Integer getFieldId()
      Return the identifier assigned to the field by the writer. Table formats such as Apache Iceberg use this to track a column when it is renamed.
      Returns:
      number or null
    • setFieldId

      public void setFieldId(Integer fieldId)
      Set up the identifier assigned to the field by the writer.
      Parameters:
      fieldId - number or null
    • getTimeUnit

      public String getTimeUnit()
      Return the unit (MILLIS, MICROS or NANOS) that a time or timestamp is stored in.
      Returns:
      string or null
    • setTimeUnit

      public void setTimeUnit(String timeUnit)
      Set up the unit that a time or timestamp is stored in.
      Parameters:
      timeUnit - string or null
    • getAdjustedToUTC

      public Boolean getAdjustedToUTC()
      Return whether a time or timestamp is an instant on the UTC timeline (true) or a local time, with no time zone, (false).
      Returns:
      boolean or null
    • setAdjustedToUTC

      public void setAdjustedToUTC(Boolean adjustedToUTC)
      Set up whether a time or timestamp is an instant on the UTC timeline or a local time.
      Parameters:
      adjustedToUTC - boolean or null
    • getChildren

      public List<ParquetSchemaElement> getChildren()
      Return the fields nested in this field. The list is empty for a leaf.
      Returns:
      list
    • isLeaf

      public boolean isLeaf()
      Return whether this field holds values (true) or is a group of other fields (false).
      Returns:
      boolean
    • isUnsigned

      public boolean isUnsigned()
      Return whether this field is an unsigned integer.
      Returns:
      boolean
    • getAnnotation

      public String getAnnotation()
      Return the name of the annotation that describes how to interpret the field, whichever style of annotation the writer used.
      Returns:
      logical type name, or the converted type, or null
    • getDataType

      public String getDataType()
      Return a description of the type of data stored in this field, using the names of types that are familiar from programming languages and databases rather than the names of the Parquet encodings. A nested field is described using array, map and struct.
      Returns:
      string
    • toString

      public String toString()
      Standard toString method.
      Overrides:
      toString in class Object
      Returns:
      print out of variables in a JSON-style