desc Verified current stable Not installed? Data Processing

Desc / Describe Table Partition

Describe Table Partition

Describes the structure of a specific partition of a table.

$
Terminal
desc <table_name> partition (<partition_spec>);

When To Use

When auditing or troubleshooting partitioned data to ensure correct distribution and integrity.

Pro Tip

Use this command to identify irregularities in partition data types versus overall table types.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
desc <table_name> partition (<partition_spec>);

Anatomy of Output

Understanding the result

+--------------+-----------+------+-----+---------+-------+ Row Separator

Begin detailing columns of the specific partition.

| Field | Type | Null | Key | Default | Extra | Column Definitions

Details about each column in the specified partition.

+--------------+-----------+------+-----+---------+-------+ Separator

Denotes the end of column definitions.

| id | int(11) | NO | PRI | NULL | | Column Entry

Indicates characteristics of the partition's columns.

| partition_key | varchar(50) | YES | | NULL | | Column Entry

Column that is key for partitioning.

+--------------+-----------+------+-----+---------+-------+ Row Separator

Completion of output.

Troubleshooting

Common pitfalls

ERROR 1146 (42S02): Table 'xyz.table_name' doesn't exist

Solution: Ensure the correct database is being accessed.

ERROR 1492 (HY000): Invalid partition specification

Solution: Verify the syntax of the specified partition.

ERROR 1050 (42S01): Table already exists with the specified name

Solution: Avoid naming conflicts or confirm table status.

Command Breakdown

What each part is doing

desc
Base Command
The executable that performs this operation. Here it runs Desc before the shell applies any redirect operators.
<table_name>
table name
The value supplied for table name.
<partition_spec>
partition spec
The value supplied for partition spec.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.