[Optional] Groups the foreign table data in storage such that all data from each column is stored together in a separate partition. Specifies partition column names and data types.
When PARTITION BY is Required
PARTITION BY is required when you omit PATHPATTERN and the paths to objects in the foreign table do not include variables.
/S3/s3.amazonaws.com/sv186025-crimedata-vcol-pq/city=ny/year_x=2015/month_x=May/Day12.parquet
/S3/s3.amazonaws.com/sv186025-crimedata-no-vcol-pq/ny/2015/May/Day12.parquet
When You Specify PATHPATTERN
When you specify PATHPATTERN, the system generates PARTITION BY, using the PATHPATTERN variable names as partition column names.
If you also specify PARTITION BY, the system ignores it.
When You Omit PATHPATTERN and Specify PARTITION BY
When you omit PATHPATTERN and specify PARTITION BY, the system generates PATHPATTERN and PARTITION BY, using the PARTITION BY column names as PATHPATTERN variable names.
When You Can Omit PATHPATTERN and PARTITION BY
You can omit PATHPATTERN and PARTITION BY when the paths to objects in the foreign table include variables. The system generates PATHPATTERN and PARTITION BY, using the variables in the paths as partition column names and PATHPATTERN variable names.
When The System Does Not Generate PARTITION BY
The system does not generate PARTITION BY if LOCATION specifies an individual file or manifest file.
Actual and Virtual Partition Columns
If a directory in an object path corresponds to a column in the foreign table, the corresponding partition column is an actual partition column.
If a directory in an object path does not correspond to a column in the foreign table, the corresponding partition column is a virtual partition column.
- SELECT statement (see SQL Data Manipulation Language, B035-1146)
- HELP TABLE output
- SHOW TABLE output
- COLLECT STATISTICS (Optimizer Form) statement
Syntax Elements
- COLUMN
- Required for NOS Parquet table, disallowed otherwise.
- partition_column_name
- Name for a partition column, a valid Teradata column name. By default, not case-specific. Partition columns can have null values.
- partition_column_data_type
- One of the following:
- BYTEINT
- SMALLINT
- INTEGER
- BIGINT
- VARCHAR
- CHAR
- DATE