Overview

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:

  1. In the Object Browser pane, right-click Regular Tables, and select Create Partition Table.
  2. Provide basic table information such as table name, tablespace, table type and so on. For more details, refer to Providing General Information.
  3. Define column related information such as column name, data type schema, data type, and column constraints. For more details, refer to Defining Columns.
  4. Select the data distribution information for the table. For more details, refer to Selecting Data Distribution.
  5. Define the column constraints for different constraint types such as primary key, unique, and check. For more details, refer to Defining Table Constraints.
  6. Define the index information for the table such as index name, access method, tablespace and so on. For more details, refer to Defining Indexes.
  7. Define the partition information for the table such as partition name, partition column, partition value and so on. For more details, refer to Defining a Partition.

    In SQL Preview tab, you can view the SQL query automatically generated for the inputs provided. For more details, refer to SQL Preview.

  8. To include comments for Column in Create Partition Table, add column information in Description of Column (Max 5000 chars) text box and click Add button.

Providing General Information

Provide the following information to create a table:

For information on completing the below fields refer to Providing General Information.

  • Table Name
  • Schema
  • Tablespace
  • Options
  • Description of Table

For completing all other fields refer below:

  1. Select table orientation from the Table Orientation drop-down list.

    If table orientation is selected as ORC, then an HDFS Partitioned table is created.

  2. Enter the ORC version number in the ORC Version field. This is applicable only for HDFS Partitioned table.
  3. After providing the general information about the table, click Next to define the columns information for the table.

    The following table lists the supported fields for each Partition type tables:

    Table 1 Supported fields

    Field Name

    Row Partition

    Column Partition

    ORC Partition

    Tablespace

    Normal

    Normal

    HDFS

    Table Type

    If Not Exists

    With OIDS

    Fill Factor

Defining Columns

Refer to Defining Columns to define column(s) for the table.

The following table lists the supported fields for each Partition type tables:

Table 2 Supported fields

Field Name

Row Partition

Column Partition

ORC Partition

Array Dimensions

Data type Schema

Not Null

Default

Unique

Check

Change Order of Partition

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.

SQL Preview

Refer to SQL Preview

Editing a Partition

Follow the steps below to edit a partition:

  1. Select the required partition.
  2. Click Edit.
  3. Edit the partition details as required and click Update to save changes.

    You must complete the edit operation and save the changes to continue with other operations

Deleting a Partition

Follow the steps below to delete a partition:

  1. Select the required partition.
  2. Click Delete.

Defining a Partition

The following table lists the supported fields/options for each partition type tables:

Table 3 Supported fields/options

Field/Option Name

Row Partition

Column Partition

ORC Partition

Partition Type

By Range

By Range

By Values

Partition Name

Partition Value

Tablespace

Normal

Normal

Follow the steps below to define partition(s) for the table:

  1. If Row or Column is selected as Table Orientation in the General tab, then By Range is displayed in the Partition Type section. If ORC is selected as Table Orientation in the General tab, then By Value is displayed in the Partition Type section.
  2. Select the column based on which partition needs be defined from the Available Column section and click .

    The column moves to the Partition Column section.

    • If Table Orientation is selected as Row or Column, then only one column can be selected for partition.
    • If Table Orientation is selected as ORC, then maximum of four columns can be selected for partition.
    • A maximum of 4 columns can be selected to define partition.

  3. Enter a name for the partition in Partition Name field.
  4. Click next to the Partition Value field.

    1. Enter the value by which you want to partition the table in Value column.
    2. Click OK.

  5. Select the tablespace name from the Tablespace drop-down list.

    Partition Name, Partition Value, Tablespace and Partitions section are disabled for ORC Partitioned tables.

  6. After you enter all information for partition, click Add.
  7. After defining all partitions, click Next.

You can perform the following operations on an existing partition for the row or column partitioned table. Below operations are not applicable for ORC Partitioned table:

Defining Indexes

Refer to Defining Indexes to define table indexes.

Table 4 Supported options

Field/Option Name

Row Partition

Column Partition

ORC Partition

Unique Index

btree

gin

gist

hash

psort

spgist

Tablespace

Normal

Normal

Fill Factor

User Defined Expression

Partial Index

Defining Table Constraints

Refer to Defining Table Constraints to define table constraint(s).

Table 5 Supported options

Option Name

Row Partition

Column Partition

ORC Partition

Check

Unique

Primary Key

Selecting Data Distribution

Refer to Selecting Data Distribution for selecting the distribution type.

Table 6 Supported options

Option Name

Row Partition

Column Partition

ORC Partition

Default

Hash

Replication