All Products
Search
Document Center

MaxCompute:DESC TABLE/VIEW

Last Updated:Mar 26, 2026

Displays information about MaxCompute internal tables, views, materialized views, foreign tables, clustered tables, or transactional tables.

Syntax

-- Basic: internal table or view, with optional partition filter
DESC <table_name | view_name> [PARTITION (<pt_spec>)];

-- Extended: materialized view, foreign table, clustered table, transactional table,
-- or extended information for an internal table
DESC EXTENDED <table_name | mv_name>;

Use DESC for a quick schema overview of an internal table or view. Add the EXTENDED keyword to get additional storage and cluster properties, or to view per-column metadata such as nullability and default values.

Parameters

Parameter Required Description
table_name Yes The name of the table to inspect.
view_name Yes The name of the view to inspect.
mv_name The name of the materialized view to inspect. Used with EXTENDED.
pt_spec No A partition filter for partitioned tables. Format: (partition_col1 = value1, partition_col2 = value2, ...).
EXTENDED Returns extended information: per-column nullability and default values for internal tables, and cluster, storage, and transaction properties for other table types.

Return values

Standard fields

Field Description
Owner The account of the table or view owner.
Project The MaxCompute project the table or view belongs to.
TableComment The comment on the table or view.
CreateTime The time the table or view was created.
LastDDLTime The time the Data Definition Language (DDL) of the table or view was last modified.
LastModifiedTime The time the data in the table or view was last modified.
LastAccessTime The approximate time the data was last accessed. Accurate to within 24 hours. If the data is accessed frequently, this value is not updated more than once every 24 hours to reduce performance overhead.
Lifecycle The lifecycle in days. Returned only when a lifecycle is set on the table.
InternalTable Specifies whether the object is an internal table. Returned only for table objects.
VirtualView Specifies whether the object is a view. Returned only for view objects.
Size The table size in bytes. Includes data currently in the recycle bin.
NativeColumns The column definitions of the table or view.
PartitionColumns The partition key column definitions. Returned only for partitioned tables.

Extended fields (DESC EXTENDED only)

DESC EXTENDED returns additional fields depending on the table type.

Materialized views

Field Description
MaterializedView Specifies whether the object is a materialized view.
ViewText The SQL query that defines the materialized view.
Rewrite Enabled Specifies whether query rewriting is enabled for the materialized view.
AutoRefresh Enabled Specifies whether automatic refresh is enabled.
IsOutdated Specifies whether the materialized view data is outdated.

Clustered tables

Cluster properties appear in the Extended Info section:

Field Description
ClusterType The cluster type: hash or range.
BucketNum The number of buckets for hash-clustered tables.
ClusterColumns The columns used for clustering.
SortColumns The columns used for sorting within each bucket (hash cluster only).

Transactional tables

Field Description
Transactional Specifies whether the table is a transactional table.
IsolationMin The minimum isolation level. For example, NONSTRICT_SNAPSHOT_ISOLATION.

Storage fields

Field Description
TableID The unique ID of the table.
IsArchived Specifies whether the table is archived.
PhysicalSize The physical storage size in bytes.
FileNum The number of files in the table.
StoredAs The storage format, such as AliOrc or CFile.
CompressionStrategy The compression strategy applied to the table.
odps.timemachine.retention.days The number of days data is retained for time travel.
ColdStorageStatus The cold storage status.
StorageTier The storage tier, such as Standard.
StorageTierLastModifiedTime The time the storage tier was last modified.
encryption_enable Specifies whether encryption is enabled.

Usage notes

  • The Size field in DESC output includes data currently in the recycle bin. To get the size without recycle bin data, run PURGE TABLE <table_name> first, then run DESC <table_name>.

  • To inspect recycle bin contents for the current project, run SHOW recyclebin.

  • To check whether a table is a transactional table, use MaxCompute client version 0.35.4 or later. Other tools not upgraded to the required version may also omit transactional information from the output.

Examples

View a non-partitioned table

Create a table and inspect it:

CREATE TABLE test_table (
    key STRING
);

DESC test_table;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 15:04:49                                      |
| LastDDLTime:              2025-12-15 15:04:50                                      |
| LastModifiedTime:         2025-12-15 15:04:49                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field           | Type       | Label | Comment                                     |
+------------------------------------------------------------------------------------+
| key             | string     |       |                                             |
+------------------------------------------------------------------------------------+

View a partitioned table

CREATE TABLE test_table_partition (
    shop_name       STRING,
    customer_id     STRING,
    total_price     DOUBLE
)
PARTITIONED BY (
    sale_date       STRING,
    region          STRING
);

DESC test_table_partition;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 15:08:27                                      |
| LastDDLTime:              2025-12-15 15:08:27                                      |
| LastModifiedTime:         2025-12-15 15:08:27                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field           | Type       | Label | Comment                                     |
+------------------------------------------------------------------------------------+
| shop_name       | string     |       |                                             |
| customer_id     | string     |       |                                             |
| total_price     | double     |       |                                             |
+------------------------------------------------------------------------------------+
| Partition Columns:                                                                 |
+------------------------------------------------------------------------------------+
| sale_date       | string     |                                                     |
| region          | string     |                                                     |
+------------------------------------------------------------------------------------+

View extended information for a partitioned table

DESC EXTENDED adds per-column nullability and default values, plus the Extended Info section with storage metadata:

CREATE TABLE IF NOT EXISTS test_table_partition (
    shop_name       STRING,
    customer_id     STRING,
    total_price     DOUBLE
)
PARTITIONED BY (
    sale_date       STRING,
    region          STRING
);

DESC EXTENDED test_table_partition;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 15:08:27                                      |
| LastDDLTime:              2025-12-15 15:08:27                                      |
| LastModifiedTime:         2025-12-15 15:08:27                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| shop_name | string |      |               | true     | NULL         |              |
| customer_id | string |    |               | true     | NULL         |              |
| total_price | double |    |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Partition Columns:                                                                 |
+------------------------------------------------------------------------------------+
| sale_date       | string     |                                                     |
| region          | string     |                                                     |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  8c4d6ed34c964326b45d0435a3babe45                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                        |
| encryption_enable:        false                                                    |
+------------------------------------------------------------------------------------+

View a table with a lifecycle

CREATE TABLE sale_detail_ctas(
    shop_name       STRING,
    customer_id     STRING,
    total_price     DOUBLE,
    sale_date       STRING,
    region          STRING
)
LIFECYCLE 10;

DESC EXTENDED sale_detail_ctas;

Output includes Lifecycle: 10 in the header section:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 15:13:22                                      |
| LastDDLTime:              2025-12-15 15:13:22                                      |
| LastModifiedTime:         2025-12-15 15:13:22                                      |
| Lifecycle:                10                                                       |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| shop_name | string |      |               | true     | NULL         |              |
| customer_id | string |    |               | true     | NULL         |              |
| total_price | double |    |               | true     | NULL         |              |
| sale_date | string |      |               | true     | NULL         |              |
| region   | string |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  8271334ac9724d09a4973b5b3d536f4c                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                 |
| ColdStorageStatus:        N/A                                                      |
| encryption_enable:        false                                                    |
| StorageTier:              Standard                                                 |
| StorageTierLastModifiedTime:  2025-12-15 15:13:22                                  |
+------------------------------------------------------------------------------------+

View a table with complex data types

CREATE TABLE test_newtype(
    c1              TINYINT,
    c2              SMALLINT,
    c3              INT,
    c4              BIGINT,
    c5              FLOAT,
    c6              DOUBLE,
    c7              DECIMAL,
    c8              BINARY,
    c9              TIMESTAMP,
    c10             ARRAY<MAP<BIGINT, BIGINT>>,
    c11             MAP<STRING, ARRAY<BIGINT>>,
    c12             STRUCT<s1:STRING, s2:BIGINT>,
    c13             VARCHAR(20)
);

DESC test_newtype;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:09:18                                      |
| LastDDLTime:              2025-12-15 16:09:18                                      |
| LastModifiedTime:         2025-12-15 16:09:18                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field           | Type       | Label | Comment                                     |
+------------------------------------------------------------------------------------+
| c1              | tinyint    |       |                                             |
| c2              | smallint   |       |                                             |
| c3              | int        |       |                                             |
| c4              | bigint     |       |                                             |
| c5              | float      |       |                                             |
| c6              | double     |       |                                             |
| c7              | decimal(38,18) |   |                                             |
| c8              | binary     |       |                                             |
| c9              | timestamp  |       |                                             |
| c10             | array<map<bigint,bigint>> |       |                              |
| c11             | map<string,array<bigint>> |       |                              |
| c12             | struct<s1:string,s2:bigint> |       |                            |
| c13             | varchar(20) |       |                                            |
+------------------------------------------------------------------------------------+

View a hash-clustered non-partitioned table

Cluster properties appear in the Extended Info section:

CREATE TABLE hash_clustered_nonpar (
    a               STRING,
    b               STRING,
    c               BIGINT
)
CLUSTERED BY (c)
SORTED BY (c ASC)
INTO 1024 BUCKETS;

DESC EXTENDED hash_clustered_nonpar;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:18:07                                      |
| LastDDLTime:              2025-12-15 16:18:07                                      |
| LastModifiedTime:         2025-12-15 16:18:07                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| a        | string |       |               | true     | NULL         |              |
| b        | string |       |               | true     | NULL         |              |
| c        | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  904e6a0d76624346903d59a2b536d0a3                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                 |
| ColdStorageStatus:        N/A                                                      |
| encryption_enable:        false                                                    |
| ClusterType:              hash                                                     |
| BucketNum:                1024                                                     |
| ClusterColumns:           [c]                                                      |
| SortColumns:              [c ASC]                                                  |
| StorageTier:              Standard                                                 |
| StorageTierLastModifiedTime:  2025-12-15 16:18:07                                  |
+------------------------------------------------------------------------------------+

View a hash-clustered partitioned table

CREATE TABLE hash_clustered_par (
    a               STRING,
    b               STRING,
    c               BIGINT
)
PARTITIONED BY (
    dt              STRING
)
CLUSTERED BY (c)
SORTED BY (c ASC)
INTO 1024 BUCKETS
LIFECYCLE 2;

DESC EXTENDED hash_clustered_par;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:26:24                                      |
| LastDDLTime:              2025-12-15 16:26:24                                      |
| LastModifiedTime:         2025-12-15 16:26:24                                      |
| Lifecycle:                2                                                        |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| a        | string |       |               | true     | NULL         |              |
| b        | string |       |               | true     | NULL         |              |
| c        | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Partition Columns:                                                                 |
+------------------------------------------------------------------------------------+
| dt              | string     |                                                     |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  5680f0711add43928389db3655d9183e                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                 |
| encryption_enable:        false                                                    |
| ClusterType:              hash                                                     |
| BucketNum:                1024                                                     |
| ClusterColumns:           [c]                                                      |
| SortColumns:              [c ASC]                                                  |
+------------------------------------------------------------------------------------+

View a range-clustered non-partitioned table

CREATE TABLE range_clustered_nonpar (
    a               STRING,
    b               STRING,
    c               BIGINT
)
RANGE CLUSTERED BY (c);

DESC EXTENDED range_clustered_nonpar;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:30:45                                      |
| LastDDLTime:              2025-12-15 16:30:45                                      |
| LastModifiedTime:         2025-12-15 16:30:45                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| a        | string |       |               | true     | NULL         |              |
| b        | string |       |               | true     | NULL         |              |
| c        | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  bf01d946c4b24c0e9c54ccfe8750b7c2                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                 |
| ColdStorageStatus:        N/A                                                      |
| encryption_enable:        false                                                    |
| ClusterType:              range                                                    |
| BucketNum:                0                                                        |
| ClusterColumns:           [c]                                                      |
| StorageTier:              Standard                                                 |
| StorageTierLastModifiedTime:  2025-12-15 16:30:45                                  |
+------------------------------------------------------------------------------------+

View a range-clustered partitioned table

CREATE TABLE range_clustered_par (
    a               STRING,
    b               STRING,
    c               BIGINT
)
PARTITIONED BY (
    dt              STRING
)
RANGE CLUSTERED BY (c);

DESC EXTENDED range_clustered_par;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:33:09                                      |
| LastDDLTime:              2025-12-15 16:33:09                                      |
| LastModifiedTime:         2025-12-15 16:33:09                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| a        | string |       |               | true     | NULL         |              |
| b        | string |       |               | true     | NULL         |              |
| c        | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Partition Columns:                                                                 |
+------------------------------------------------------------------------------------+
| dt              | string     |                                                     |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  bdc4f6897691479ea9c315664f26fe39                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                 |
| encryption_enable:        false                                                    |
| ClusterType:              range                                                    |
| BucketNum:                0                                                        |
| ClusterColumns:           [c]                                                      |
+------------------------------------------------------------------------------------+

Check whether a non-partitioned table is a transactional table

Use MaxCompute client version 0.35.4 or later. Other tools not upgraded to the required version may also omit transactional information from the output.
CREATE TABLE tran_nonpar (
    id              BIGINT
)
TBLPROPERTIES ('transactional'='true');

DESC EXTENDED tran_nonpar;

The Transactional property appears in the Extended Info section:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:37:27                                      |
| LastDDLTime:              2025-12-15 16:37:27                                      |
| LastModifiedTime:         2025-12-15 16:37:27                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| id       | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  43e9710c2b4c404780a7be9998afb23e                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| Transactional:            true                                                     |
| IsolationMin:             NONSTRICT_SNAPSHOT_ISOLATION                             |
| odps.timemachine.retention.days: 1                                                 |
| ColdStorageStatus:        N/A                                                      |
| encryption_enable:        false                                                    |
| StorageTier:              Standard                                                 |
| StorageTierLastModifiedTime:  2025-12-15 16:37:27                                  |
+------------------------------------------------------------------------------------+

Check whether a partitioned table is a transactional table

Use MaxCompute client version 0.35.4 or later. Other tools not upgraded to the required version may also omit transactional information from the output.
CREATE TABLE tran_par (
    id              BIGINT
)
PARTITIONED BY (
    ds              STRING
)
TBLPROPERTIES ('transactional'='true');

DESC EXTENDED tran_par;

The Transactional property appears in the Extended Info section:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:42:26                                      |
| LastDDLTime:              2025-12-15 16:42:26                                      |
| LastModifiedTime:         2025-12-15 16:42:26                                      |
+------------------------------------------------------------------------------------+
| InternalTable: YES      | Size: 0                                                  |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| id       | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Partition Columns:                                                                 |
+------------------------------------------------------------------------------------+
| ds              | string     |                                                     |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| TableID:                  d4dd59b15f7940bcad4cb5efdb42f242                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 AliOrc                                                   |
| CompressionStrategy:      normal                                                   |
| Transactional:            true                                                     |
| IsolationMin:             NONSTRICT_SNAPSHOT_ISOLATION                             |
| odps.timemachine.retention.days: 1                                                 |
| encryption_enable:        false                                                    |
+------------------------------------------------------------------------------------+

View a materialized view

-- Create a base table.
CREATE TABLE page_view_logs (
    page_id STRING,
    user_id STRING,
    view_timestamp BIGINT
);

-- Create a materialized view that aggregates page views per page.
CREATE MATERIALIZED VIEW mv AS
SELECT
    page_id,
    COUNT(1) AS pv_count
FROM
    page_view_logs
GROUP BY
    page_id;

DESC EXTENDED mv;

Output:

+------------------------------------------------------------------------------------+
| Owner:                    ALIYUN$***_com                                           |
| Project:                  testproject                                              |
| TableComment:                                                                      |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:47:51                                      |
| LastDDLTime:              2025-12-15 16:47:51                                      |
| LastModifiedTime:         2025-12-15 16:47:51                                      |
+------------------------------------------------------------------------------------+
| MaterializedView: YES                                                              |
| ViewText: SELECT
    page_id,
    COUNT(1) AS pv_count
FROM
    page_view_logs
GROUP BY
    page_id |
| Rewrite Enabled: true                                                              |
| AutoRefresh Enabled: false                                                         |
+------------------------------------------------------------------------------------+
| Native Columns:                                                                    |
+------------------------------------------------------------------------------------+
| Field    | Type   | Label | ExtendedLabel | Nullable | DefaultValue | Comment      |
+------------------------------------------------------------------------------------+
| page_id  | string |       |               | true     | NULL         |              |
| pv_count | bigint |       |               | true     | NULL         |              |
+------------------------------------------------------------------------------------+
| Extended Info:                                                                     |
+------------------------------------------------------------------------------------+
| IsOutdated:               false                                                    |
| TableID:                  a8742f3751904ec3ade23a7ecc2a2b0b                         |
| IsArchived:               false                                                    |
| PhysicalSize:             0                                                        |
| FileNum:                  0                                                        |
| StoredAs:                 CFile                                                    |
| CompressionStrategy:      normal                                                   |
| odps.timemachine.retention.days: 1                                                        |
| ColdStorageStatus:        N/A                                                      |
| encryption_enable:        false                                                    |
| StorageTier:              Standard                                                 |
| StorageTierLastModifiedTime:  2025-12-15 16:47:51                                  |
+------------------------------------------------------------------------------------+

Query partition information

-- Create a partitioned table.
CREATE TABLE IF NOT EXISTS test_table_partition (
    shop_name       STRING,
    customer_id     STRING,
    total_price     DOUBLE
)
PARTITIONED BY (
    sale_date       STRING,
    region          STRING
);

-- Add a partition and insert data.
ALTER TABLE test_table_partition ADD IF NOT EXISTS
  PARTITION (sale_date='201310', region='beijing');

INSERT INTO TABLE test_table_partition PARTITION (sale_date='201310', region='beijing')
VALUES
    ('Apple Store', 'user001', 8888.0),
    ('Nike Store', 'user002', 1200.5),
    ('Starbucks', 'user001', 45.0);

-- Query the partition.
DESC test_table_partition PARTITION (sale_date='201310', region='beijing');

Output:

+------------------------------------------------------------------------------------+
| PartitionSize: 1163                                                                |
+------------------------------------------------------------------------------------+
| CreateTime:               2025-12-15 16:54:16                                      |
| LastDDLTime:              2025-12-15 16:54:16                                      |
| LastModifiedTime:         2025-12-15 16:54:23                                      |
+------------------------------------------------------------------------------------+

Related commands