Skip to main content

Orc

The Apache Orc format allows to read and write Orc data.

Example of use

    CREATE TABLE user_behavior (
user_id BIGINT,
item_id BIGINT,
category_id BIGINT,
behavior STRING,
ts TIMESTAMP(3),
dt STRING
) PARTITIONED BY (dt) WITH (
'connector' = 'filesystem',
'path' = '/tmp/user_behavior',
'format' = 'orc'
)

Format option

OptionRequiredDefaultTypeDescription
formatyes(none)StringSpecify what format to use, here should be ‘orc’.

Data type mapping

Orc format type mapping is compatible with Apache Hive. The following table lists the type mapping from Flink type to Orc type.

Flink Data TypeOrc physical typeOrc logical type
Flink Data TypeOrc physical typeOrc logical type
CHARbytesCHAR
VARCHARbytesVARCHAR
STRINGbytesSTRING
BOOLEANlongBOOLEAN
BYTESbytesBINARY
DECIMALdecimalDECIMAL
TINYINTlongBYTE
SMALLINTlongSHORT
INTlongINT
BIGINTlongLONG
FLOATdoubleFLOAT
DOUBLEdoubleDOUBLE
DATElongDATE
TIMESTAMPtimestampTIMESTAMP
ARRAYnoneLIST
MAPnoneMAP
ROWnoneSTRUCT
note

This page is derived from the official Apache Flink® documentation.

Refer to the Credits page for more information.