ORC
This document introduces the support for reading and writing ORC file formats in VeloDB Cloud. It applies to the following functionalities:
- Reading and writing data in the Catalog.
- Reading data using Table Valued Functions.
- Reading data with Broker Load.
- Writing data during Export.
- Writing data with Outfile.
Supported compression formats
- uncompressed
- snappy
- lz4
- zstd
- lzo
- zlib
Parameters
Timestamp and date compatibility
In VeloDB Core 26.1.3, ORC TIMESTAMP maps to DATETIME(6). TIMESTAMP_INSTANT maps to TIMESTAMPTZ(6) when time-zone mapping is enabled for the catalog or TVF, and otherwise maps to DATETIME(6). Confirm the selected compatibility settings before exchanging timestamp files.
In a future release, stricter ORC timestamp compatibility is planned: TIMESTAMP represents wall-clock time without a time zone, while TIMESTAMP_INSTANT represents an instant and maps to TIMESTAMPTZ. Reads round nanoseconds to microseconds. Out-of-range values and invalid nanosecond values produce errors.
Under the planned writer validation, some negative fractional timestamps immediately before the Unix epoch cannot be represented without data loss. VeloDB Cloud returns ORC cannot represent pre-epoch timestamp fractions in -0.999, 0) seconds without data loss; use Parquet for these values. Use Parquet for data containing these values.
Under the planned date migration rules, DATE files written with the old Apache Doris encoding and containing 0000-01-01 through 0000-02-28 require explicit migration. Retain the writer version and validate rewritten dates before migration.
Session variables
-
enable_orc_lazy_materializationControls whether the ORC Reader enables lazy materialization. Default is true.
-
hive_orc_use_column_namesWhen reading ORC data types from Hive tables, VeloDB Cloud will, by default, read data from columns in the ORC file that have the same name as the columns in the Hive table. When this variable is set to
false, VeloDB Cloud will read data from the ORC file based on the column order in the Hive table, regardless of column names. This is similar to theorc.force.positional.evolutionvariable in Hive. This parameter only applies to top-level column names and is ineffective for columns inside Structs. -
orc_tiny_stripe_threshold_bytesIn ORC files, if the byte size of a Stripe is less than
orc_tiny_stripe_threshold_bytes, it is considered a Tiny Stripe. For multiple consecutive Tiny Stripes, read optimization will be performed, i.e., multiple Tiny Stripes will be read at once to reduce the number of IO operations. If you do not want to use this optimization, you can set this value to 0. Default is 8M. -
orc_once_max_read_bytesWhen using Tiny Stripe read optimization, multiple Tiny Stripes will be merged into a single IO operation. This parameter controls the maximum number of bytes for each IO request. You should not set this value smaller than
orc_tiny_stripe_threshold_bytes. Default is 8M. -
orc_max_merge_distance_bytesWhen using Tiny Stripe read optimization, since two Tiny Stripes to be read may not be consecutive, if the distance between two Tiny Stripes is greater than this parameter, they will not be merged into a single IO operation. Default is 1M.
Note:
orc_tiny_stripe_amplification_factor, described in upstream Apache Doris documentation, is not exposed by the VeloDB Core 26.1.3 session-variable implementation. Do not use it to tune this release.
-
check_orc_init_sargs_successChecks whether ORC predicate pushdown is successful, used for debugging. Default is false.
Managed service settings
The following are engine configuration settings managed by VeloDB Cloud. Ask VeloDB Cloud support before requesting a change. Listed defaults are source defaults, not a report of the effective warehouse configuration.
-
orc_natural_read_size_mbThe maximum number of bytes that the ORC Reader reads at one time. Default is 8 MB.