ORC (Parser)

Use the ORC clause with the COPY statement to load data in the ORC format.

The ORC clause can be used alone or with optional parameters.

Parameters

hive_partition_cols Comma-separated list of columns that are partition columns in the data. See Using Partition Columns.

flatten_complex_type_null

Whether to flatten a null struct value to null values for all of its fields (true) or reject a row containing a null struct value (false, default). See Reading Structs.

allow_no_match

Whether to accept a path containing a glob with no matching files and report zero rows in query results. If this parameter is not set, Vertica returns an error if the path in the FROM clause does not match at least one file.

Examples

Use the ORC clause without parameters if your data is not partitioned.

=> COPY t FROM 's3://AWS_DataLake/sales.orc' ORC;

In the following example, the "id" and "name" columns are included in the data and the "created" and "region" columns are partition columns. Partition columns must be listed last when defining columns.

=> CREATE EXTERNAL TABLE t (id int, name varchar(50), created date, region varchar(50))
   AS COPY FROM 'hdfs:///path/*/*/*' 
   ORC(hive_partition_cols='created,region');

In the following example, the data contains structs and a null value should not reject the row.

=> CREATE EXTERNAL TABLE customers_expanded (...)
    AS COPY FROM '...' ORC(flatten_complex_type_nulls='True');