Class ParquetSchemaElement
java.lang.Object
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.properties.ParquetSchemaElement
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 -
Method Summary
Modifier and TypeMethodDescriptionReturn 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.getName()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.getScale()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.booleanisLeaf()Return whether this field holds values (true) or is a group of other fields (false).booleanReturn whether a value can be missing for this field.booleanReturn whether this field is an unsigned integer.voidsetAdjustedToUTC(Boolean adjustedToUTC) Set up whether a time or timestamp is an instant on the UTC timeline or a local time.voidsetConvertedType(String convertedType) Set up the converted type.voidsetFieldId(Integer fieldId) Set up the identifier assigned to the field by the writer.voidsetLogicalType(String logicalType) Set up the description of the logical type.voidsetLogicalTypeName(String logicalTypeName) Set up the name of the logical type.voidSet up the name of the field.voidsetPathName(String pathName) Set up the dot-separated path name.voidsetPhysicalType(String physicalType) Set up the type used to store the values.voidsetPrecision(Integer precision) Set up the total number of digits in a decimal.voidsetRepetition(String repetition) Set up whether the field is REQUIRED, OPTIONAL or REPEATED.voidSet up the number of digits after the decimal point for a decimal.voidsetTimeUnit(String timeUnit) Set up the unit that a time or timestamp is stored in.voidsetTypeLength(Integer typeLength) Set up the number of bytes in each value.toString()Standard toString method.
-
Constructor Details
-
ParquetSchemaElement
public ParquetSchemaElement()Default constructor.
-
-
Method Details
-
getName
Return the name of the field.- Returns:
- string
-
setName
Set up the name of the field.- Parameters:
name- 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
Set up the dot-separated path name.- Parameters:
pathName- 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
Set up the type used to store the values.- Parameters:
physicalType- string
-
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
Set up the number of bytes in each value.- Parameters:
typeLength- number of bytes or null
-
getRepetition
Return whether the field is REQUIRED, OPTIONAL or REPEATED.- Returns:
- string
-
setRepetition
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
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
Set up the converted type.- Parameters:
convertedType- string or null
-
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
Set up the description of the logical type.- Parameters:
logicalType- string or null
-
getLogicalTypeName
Return the name of the logical type annotation without its parameters, such as TIMESTAMP.- Returns:
- string or null
-
setLogicalTypeName
Set up the name of the logical type.- Parameters:
logicalTypeName- string or null
-
getScale
Return the number of digits after the decimal point for a decimal.- Returns:
- number or null
-
setScale
Set up the number of digits after the decimal point for a decimal.- Parameters:
scale- number or null
-
getPrecision
Return the total number of digits in a decimal.- Returns:
- number or null
-
setPrecision
Set up the total number of digits in a decimal.- Parameters:
precision- number or null
-
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
Set up the identifier assigned to the field by the writer.- Parameters:
fieldId- number or null
-
getTimeUnit
Return the unit (MILLIS, MICROS or NANOS) that a time or timestamp is stored in.- Returns:
- string or null
-
setTimeUnit
Set up the unit that a time or timestamp is stored in.- Parameters:
timeUnit- string or null
-
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
Set up whether a time or timestamp is an instant on the UTC timeline or a local time.- Parameters:
adjustedToUTC- boolean or null
-
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
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
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
Standard toString method.
-