Partitioning refers to splitting what is logically one large table into smaller physical pieces based on specific schemes. The table based on the logic is called a partitioned table, and a physical piece is called a partition. Data is stored on these smaller physical pieces, namely, partitions, instead of the larger logical partitioned table.
Follow the steps below to define a table in your database:
On the SQL Preview tab, you can check the automatically generated SQL query. For details, see Checking the SQL Preview.
For details, see Providing Basic Information.
Perform the following steps to configure other parameters:
If table orientation is selected as ORC, then an HDFS Partitioned table is created.
The following table describes the parameters of partitioned tables.
Parameter |
Row Partition |
Column Partition |
ORC Partition |
---|---|---|---|
Table Type |
x |
x |
x |
If Not Exists |
√ |
√ |
√ |
With OIDS |
x |
x |
x |
Fill Factor |
√ |
x |
x |
The following table describes the parameters of partitioned tables.
Parameter |
Row Partition |
Column Partition |
ORC Partition |
---|---|---|---|
Array Dimensions |
√ |
x |
x |
Data Type |
√ |
x |
x |
NOT NULL |
√ |
√ |
√ |
Default |
√ |
√ |
√ |
UNIQUE |
√ |
x |
x |
CHECK |
√ |
x |
x |
You can change the order of partition as required in the table. To change the order, select the required partition and click Up or Down.
Perform the following steps to edit a partition:
You must complete the edit operation and save the changes to continue with other operations.
Perform the following steps to delete a partition:
The following table describes the parameters of partitioned tables.
Parameter |
Row Partition |
Column Partition |
ORC Partition |
---|---|---|---|
Partition Type |
By Range |
By Range |
By Value |
Partition Name |
√ |
√ |
x |
Partition Value |
√ |
√ |
x |
Perform the following steps to define a table partition:
The column will be moved to the Partition Column area.
You can perform the following operations on the partitions of a row-or column-partitioned table, but not on ORC partitioned tables:
For details about index definitions, see Defining an Index.
Parameter |
Row Partition |
Column Partition |
ORC Partition |
---|---|---|---|
Unique Indexes |
√ |
x |
x |
btree |
√ |
√ |
x |
gin |
√ |
√ |
x |
gist |
√ |
√ |
x |
hash |
√ |
√ |
x |
psort |
√ |
√ |
x |
spgist |
√ |
√ |
x |
Fill Factor |
√ |
x |
x |
User Defined Expression |
√ |
x |
x |
Partial Index |
√ |
x |
x |
For details about how to define table constraints, see Defining Table Constraints.
Parameter |
Partition |
Column Partition |
ORC Partition |
---|---|---|---|
Check |
√ |
x |
x |
Unique |
√ |
x |
x |
Primary Key |
√ |
x |
x |
For details about how to select a distribution type, see Selecting Data Distribution.
Parameter |
Row Partition |
Column Partition |
ORC Partition |
---|---|---|---|
DEFAULT DISTRIBUTION |
√ |
√ |
x |
Hash |
√ |
√ |
√ |
Replication |
√ |
√ |
x |