Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Partitioned Table

Updated on 2025-02-26 GMT+08:00

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 choose Create Partition Table.
  2. Define basic table information, such as the table name and table type. For details, see Providing Basic Information.
  3. Define column information, such as the column name, data type schema, data type, and column constraint. For details, see Defining a Column.
  4. Select the data distribution information for the table. For details, see Configuring Data Distribution.
  5. Define column constraints for different constraint types. Constraint types include PRIMARY KEY, UNIQUE, and CHECK. For details, see Defining Table Constraints.
  6. Define table index information, such as the index name and access mode. For details, see Defining an Index.
  7. Define the partition information for the table such as partition name, partition column, partition value and so on. For details, see Defining a Partition.

    On the SQL Preview tab, you can check the automatically generated SQL query. For details, see SQL Preview.

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

Providing Basic Information

If you create a table in a schema, the current schema will be used as the schema of the table. Perform the following steps to create a partitioned table:

  1. Select a table storage mode from the Table Orientation drop-down list.

    NOTE:

    If table orientation is selected as ORC, then an HDFS Partitioned table is created. Enter the ORC version number in ORC Version.

  2. After providing the general information about the table, click Next to define the columns information for the table.

    The following table describes the parameters of partitioned tables.

    Table 1 Parameters

    Parameter

    Row Partition

    Column Partition

    ORC Partition

    Table Type

    x

    x

    x

    If Not Exists

    With OIDS

    x

    x

    x

    Fill Factor

    x

    x

Defining a Column

The following table describes the parameters of partitioned tables.

Table 2 Parameters

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 add, delete, and edit columns, and adjust the sequence of columns.

You can change the order of partitions in the table as required. To change the order, select the required partition and click Up or Down.

SQL Preview

Data Studio generates a DDL statement based on the inputs provided in Create New table wizard.

You can only view, select, and copy the query. You cannot edit the query.

  • To select all queries, press Ctrl+A or right-click and select Select All.
  • To copy the selected query, press Ctrl+C or right-click and select Copy.

Click Finish to create the table. On clicking the Finish button, the generated query will be sent to the server. Any errors are displayed in the dialog box and status bar.

Defining a Partition

The following table describes the parameters of partitioned tables.

Table 3 Parameters

Parameter

Row Partition

Column Partition

ORC Partition

Partition Type

By Range

By Range

By Value

Partition Name

x

Partition Value

x

  1. If Row or Column is selected for Table Orientation on the General tab, By Range will be displayed in the Partition Type area. If ORC is selected for Table Orientation on the General tab, By Value will be displayed in the Partition Type area.
  2. In the Available Column area, select a column and click the Right Arrow button. The column will be moved to the Partition Column area.

    NOTE:
    • If Table Orientation is set to Row or Column, only one column can be selected for partitioning.
    • If Table Orientation is set to ORC, up to four columns can be selected for partitioning.
    • A maximum of four columns can be selected to define partitions.

  3. Enter a partition name.
  4. Click the Enter Partition Value button next to Partition Value. Enter the value by which you want to partition the table in Value column. Click OK.
  5. After you enter all information for partition, click Add.

    You can add, delete, edit and move a column.

    Change the partition sequence according to the requirements in the table. To change the order, select the required partition and click Up or Down.

  6. After defining all partitions, click Next.

Defining an Index

For details about index definitions, see Defining an Index.

Table 4 Parameters

Parameter

Row-store Table

Column-store Table

ORC Table

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

Defining Table Constraints

For details about how to define table constraints, see Defining Table Constraints.

Table 5 Parameters

Parameter

Row Partition

Column Partition

ORC Table

Check

x

x

Unique

x

x

Primary Key

x

x

Configuring Data Distribution

For details about how to configure a distribution type, see Selecting Data Distribution.

Table 6 Parameters

Parameter

Row Partition

Column Partition

ORC Partition

DEFAULT DISTRIBUTION

x

Hash

Replication

x

Dropping a Partition

  1. Right-click the selected index and select Drop Partition.

    Drop Partition Table dialog box is displayed.

  2. Click OK.

    The partition is deleted from the table. Data Studio displays the status of the operation in the status bar.

Renaming a partition

  1. Right-click the selected partition and select Rename Partition.

    Rename Partition Table dialog box is displayed prompting you to provide the new name for the partition.

  2. Enter new name and click OK.

    Data Studio displays the status of the operation in the status bar.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback