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.
Properties
- $_TSPEC : mixed
- $converted_type : null|int
- DEPRECATED: When the schema is the result of a conversion from another model.
- $field_id : null|int
- When the original schema supports field ids, this will save the original field id in the parquet schema
- $isValidate : mixed
- $logicalType : null|LogicalType
- The logical type of this SchemaElement
- $name : string
- Name of the field in the schema
- $num_children : null|int
- Nested fields. Since thrift does not support nested fields, the nesting is flattened to a single list by a depth-first traversal.
- $precision : null|int
- $repetition_type : null|int
- repetition of the field. The root of the schema does not have a repetition_type.
- $scale : null|int
- DEPRECATED: Used when this column contains decimal data.
- $type : null|int
- Data type for this field. Not set if the current element is a non-leaf node
- $type_length : null|int
- If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the values.
Methods
- __construct() : mixed
- getName() : mixed
- read() : mixed
- write() : mixed
Properties
$_TSPEC
public
static mixed
$_TSPEC
= array(1 => array('var' => 'type', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32, 'class' => '\Flow\Parquet\ThriftModel\Type'), 2 => array('var' => 'type_length', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32), 3 => array('var' => 'repetition_type', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32, 'class' => '\Flow\Parquet\ThriftModel\FieldRepetitionType'), 4 => array('var' => 'name', 'isRequired' => true, 'type' => \Thrift\Type\TType::STRING), 5 => array('var' => 'num_children', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32), 6 => array('var' => 'converted_type', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32, 'class' => '\Flow\Parquet\ThriftModel\ConvertedType'), 7 => array('var' => 'scale', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32), 8 => array('var' => 'precision', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32), 9 => array('var' => 'field_id', 'isRequired' => false, 'type' => \Thrift\Type\TType::I32), 10 => array('var' => 'logicalType', 'isRequired' => false, 'type' => \Thrift\Type\TType::STRUCT, 'class' => '\Flow\Parquet\ThriftModel\LogicalType'))
$converted_type
DEPRECATED: When the schema is the result of a conversion from another model.
public
null|int
$converted_type
= null
Used to record the original type to help with cross conversion.
This is superseded by logicalType.
$field_id
When the original schema supports field ids, this will save the original field id in the parquet schema
public
null|int
$field_id
= null
$isValidate
public
static mixed
$isValidate
= false
$logicalType
The logical type of this SchemaElement
public
null|LogicalType
$logicalType
= null
LogicalType replaces ConvertedType, but ConvertedType is still required for some logical types to ensure forward-compatibility in format v1.
$name
Name of the field in the schema
public
string
$name
= null
$num_children
Nested fields. Since thrift does not support nested fields, the nesting is flattened to a single list by a depth-first traversal.
public
null|int
$num_children
= null
The children count is used to construct the nested relationship. This field is not set when the element is a primitive type
$precision
public
null|int
$precision
= null
$repetition_type
repetition of the field. The root of the schema does not have a repetition_type.
public
null|int
$repetition_type
= null
All other nodes must have one
$scale
DEPRECATED: Used when this column contains decimal data.
public
null|int
$scale
= null
See the DECIMAL converted type for more details.
This is superseded by using the DecimalType annotation in logicalType.
$type
Data type for this field. Not set if the current element is a non-leaf node
public
null|int
$type
= null
$type_length
If type is FIXED_LEN_BYTE_ARRAY, this is the byte length of the values.
public
null|int
$type_length
= null
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.
Methods
__construct()
public
__construct([mixed $vals = null ]) : mixed
Parameters
- $vals : mixed = null
getName()
public
getName() : mixed
read()
public
read(mixed $input) : mixed
Parameters
- $input : mixed
write()
public
write(mixed $output) : mixed
Parameters
- $output : mixed