Skip to content

Parquet Schema Mapping and Type Casting

This section lays out the mapping and casting support for parquet types to Yellowbrick data types (data types supported for storage in columns in Yellowbrick tables).

Mapping for Parquet Boolean Type

The parquet boolean type maps directly to the Yellowbrick boolean data type. No other mappings are supported.

Mappings for Parquet INT32 Types

The following table indicates which parquet INT32 data types map to Yellowbrick data types, either directly or with casting.

The first row in the table refers to the parquet primitive type, and the subsequent rows to annotated logical types.

CHAR, VARCHARBOOLEANSMALLINTINTBIGINTREALDOUBLEDECIMALDATETIMETIMESTAMP, TIMESTAMPTZUUIDIPV4, IPV6MACADDR, MACADDR8
INT32Yes, with castNoYes, with castYesYes, with castYes, with castYes, with castYes, with castNoNoNoNoNoNo
INT/UINT (8/16/32, sign)Yes, with castNoYes: INT(8), UINT(8), INT(16)Yes: UINT(16),INT(32)Yes: UINT(32)Yes, with castYes, with castYes, with castNoNoNoNoNoNo
DECIMAL (1-9)Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYesNoNoNoNoNoNo
DATEYes, with castNoNoNoNoNoNoNoYesNoYes, with castNoNoNo
TIME (MILLIS)Yes, with castNoNoNoNoNoNoNoNoYesNoNoNoNo

Mappings for Parquet INT64 Types

The following table indicates which parquet INT64 data types map to Yellowbrick data types, either directly or with casting.

The first row in the table refers to the parquet primitive type, and the subsequent rows to annotated logical types.

CHAR, VARCHARBOOLEANSMALLINTINTBIGINTREALDOUBLEDECIMALDATETIMETIMESTAMP, TIMESTAMPTZUUIDIPV4, IPV6MACADDR, MACADDR8
INT64Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castNoNoNoNoNoNo
INT/UINT(64, sign)Yes, with castNoYes, with castYes, with castYes: INT(64)Yes, with castYes, with castYes: UINT(64)NoNoNoNoNoNo
DECIMAL (1-18)Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYesNoNoNoNoNoNo
TIME (MICROS, NANOS)Yes, with castNoNoNoNoNoNoNoNoYesNoNoNoNo
TIMESTAMP (UTC, unit)Yes, with castNoNoNoNoNoNoNoYes, with castYes, with castYesNoNoNo

Mapping for Parquet FLOAT, DOUBLE, and INT96 Types

The following table indicates which parquet FLOAT, DOUBLE, and INT96 data types map to Yellowbrick data types, either directly or with casting.

CHAR, VARCHARBOOLEANSMALLINTINTBIGINTREALDOUBLEDECIMALDATETIMETIMESTAMP, TIMESTAMPTZUUIDIPV4, IPV6MACADDR, MACADDR8
FLOATYes, with castNoNoNoNoYesYes, with castNoNoNoNoNoNoNo
DOUBLEYes, with castNoNoNoNoYes, with castYesNoNoNoNoNoNoNo
INT96
(--int96-as-timestamp)
Yes, with castNoNoNoNoNoNoNoYes, with castYes, with castYesNoNoNo
INT96
(--no-int96-as-timestamp)
Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYesNoNoNoNoNoNo

Mapping for Parquet Byte Array Types

The following table indicates which parquet byte array data types map to Yellowbrick data types, either directly or with casting.

The first row in the table refers to the parquet primitive type, and the subsequent rows to annotated logical types.

CHAR, VARCHARBOOLEANSMALLINTINTBIGINTREALDOUBLEDECIMALDATETIMETIMESTAMP, TIMESTAMPTZUUIDIPV4, IPV6MACADDR, MACADDR8
BYTE ARRAYYesNoNoNoNoNoNoNoNoNoNoNoNoNo
STRING/UTF-8YesYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with castYes, with cast
ENUMYesNoNoNoNoNoNoNoNoNoNoNoNoNo
DECIMAL(N)Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYesNoNoNoNoNoNo
JSONYesNoNoNoNoNoNoNoNoNoNoNoNoNo
BSONYesNoNoNoNoNoNoNoNoNoNoNoNoNo

Mapping for Parquet Fixed-Length Byte-Array Types

The following table indicates which parquet fixed-length byte-array data types map to Yellowbrick data types, either directly or with casting.

The first row in the table refers to the parquet primitive type, and the subsequent rows to annotated logical types.

CHAR, VARCHARBOOLEANSMALLINTINTBIGINTREALDOUBLEDECIMALDATETIMETIMESTAMP, TIMESTAMPTZUUIDIPV4, IPV6MACADDR, MACADDR8
FIXED-LENGTH BYTE-ARRAYYesNoNoNoNoNoNoNoNoNoNoNoNoNo
16/UUIDYes, with castNoNoNoNoNoNoNoNoNoNoYesNoNo
N/DECIMAL(N)Yes, with castNoYes, with castYes, with castYes, with castYes, with castYes, with castYesNoNoNoNoNoNo
12/IntervalNoNoNoNoNoNoNoNoNoNoNoNoNoNo