表修改和查看命令如下。
命令類別 | 類型 | 功能 | 角色 | 操作入口 |
修改表 | 修改表的所有人 | 修改表的所有人,即表Owner。 | 專案Owner。 | 本文中的命令可以在如下工具平台執行: |
修改表的注釋 | 修改表的注釋內容。 | 具備修改表許可權(Alter)的使用者。 |
修改表的最後更新時間 | 修改表的LastModifiedTime為目前時間。 |
修改表的聚簇屬性 | 增加或去除表的聚簇屬性。 |
修改表名 | 修改表的名稱。 |
清空非分區表裡的資料 | 清空指定的非分區表中的資料。 |
清空列資料 | 清空普通表的列。 |
查看錶 | 查看錶資訊 | 查看MaxCompute內部表、外部表格、聚簇表或Transactional表的資訊。 | 具備讀取表元資訊許可權(Describe)的使用者。 |
查看建表語句 | 查看錶的DDL語句。 |
列出專案下的表和視圖 | 列出專案下所有的內部表和外部表格,或符合某些規則的內部表和外部表格。 | 具備專案查看對象列表許可權(List)的使用者。 |
列出專案下外部表格 | 列出專案下所有的外部表格,或符合某些規則的外部表格。 |
修改表的所有人
修改表的所有人,即表Owner。
重要 僅專案所有者(Project Owner)或具備Super_Administrator角色的使用者可執行修改表Owner的命令。
命令格式
ALTER TABLE <table_name> CHANGEOWNER TO <new_owner>;
參數說明
參數 | 是否必填 | 說明 |
table_name | 是 | 待修改Owner的表名。 |
new_owner | 是 | 修改後的Owner帳號。
說明 修改表Owner為RAM使用者,需確保RAM使用者已加入到表所在的專案中。 |
使用樣本
本文樣本資料sale_detail表的建立,詳情請參見建立sale_detail表。
將表sale_detail的所有人修改為ALIYUN$xxx@aliyun.com。
ALTER TABLE sale_detail CHANGEOWNER TO 'ALIYUN$xxx@aliyun.com';
將表sale_detail的所有人修改為名稱為ram_test的RAM使用者。
ALTER TABLE sale_detail CHANGEOWNER TO 'RAM$13xxxxxxxxxxx:ram_test';
修改表的注釋
修改表的注釋內容。
命令格式
ALTER TABLE <table_name> SET COMMENT '<new_comment>';
參數說明
參數 | 是否必填 | 說明 |
table_name | 是 | 待修改注釋的表的名稱。 |
new_comment | 是 | 修改後的注釋名稱。 |
使用樣本
ALTER TABLE sale_detail SET COMMENT 'new comment for table sale_detail';
通過MaxCompute的DESC <table_name>命令可以查看錶中comment的修改結果。
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$sant****.aliyunid.com |
| Project: ani**** |
| Schema: default |
| TableComment: new comment for table sale_detail |
+------------------------------------------------------------------------------------+
修改表的最後更新時間
MaxCompute SQL提供TOUCH操作用來修改表的LastModifiedTime,可將表的LastModifiedTime修改為目前時間。此操作會改變表的LastModifiedTime的值,MaxCompute會認為表的資料有變動,生命週期的計算會重新開始。
命令格式
ALTER TABLE <table_name> TOUCH;
參數說明
table_name:必填。待修改表的修改時間的表名稱。
使用樣本
ALTER TABLE sale_detail TOUCH;
修改表的聚簇屬性
對於分區表,MaxCompute支援通過ALTER TABLE語句增加或者去除聚簇屬性。
命令格式
增加表的Hash聚簇屬性的文法格式如下。
ALTER TABLE <table_name>
[CLUSTERED BY (<col_name> [, <col_name>, ...])
[SORTED BY (<col_name> [ASC | DESC] [, <col_name> [ASC | DESC] ...])]
INTO <number_of_buckets> BUCKETS];
去除表的Hash聚簇屬性的文法格式如下。
ALTER TABLE <table_name> NOT CLUSTERED;
增加表的Range聚簇屬性,Bucket數不是必需的,可以省略,此時系統會根據資料量自動決定最佳的Bucket數目。文法格式如下。
ALTER TABLE <table_name>
[RANGE CLUSTERED BY (<col_name> [, <col_name>, ...])
[SORTED BY (<col_name> [ASC | DESC] [, <col_name> [ASC | DESC] ...])]
INTO <number_of_buckets> BUCKETS];
去除表或分區的Range聚簇屬性的文法格式如下。
ALTER TABLE <table_name> NOT CLUSTERED;
ALTER TABLE <table_name> PARTITION <pt_spec> NOT CLUSTERED;
說明 通過ALTER TABLE改變聚簇屬性,只對分區表有效,非分區表一旦建立聚簇屬性就無法改變。ALTER TABLE語句適用於存量表,在增加了新的聚簇屬性後,新的分區將按設定的聚簇屬性儲存區。
ALTER TABLE只會影響分區表的建立分區(包括INSERT OVERWRITE產生的),新分區將按新的聚簇屬性儲存區,老資料分區的聚簇屬性和儲存保持不變。即在一張曾經做過聚簇屬性設定的表上,關閉了聚簇屬性,再增加聚簇設定,可以在新分區設定不同於之前的聚簇列、排序列及分桶數。
由於ALTER TABLE隻影響新分區,所以該語句不可以再指定分區。
修改表名
修改表的名稱。僅修改表的名字,不改動表中的資料。
命令格式
ALTER TABLE <table_name> RENAME TO <new_table_name>;
參數說明
參數 | 是否必填 | 說明 |
table_name | 是 | 待修改名稱的表。 |
new_table_name | 是 | 修改後的表名稱。如果已存在與new_table_name同名的表,會返回報錯。 |
使用樣本
ALTER TABLE sale_detail RENAME TO sale_detail_rename;
清空非分區表裡的資料
將指定的非分區表中的資料清空。如果您需要清空分區表中單個或多個分區的資料,請參見清空分區資料。
命令格式
TRUNCATE TABLE <table_name>;
參數說明
table_name:必填。待清空資料的非分區表的名稱。
清空列資料
使用clear column命令清空普通表的列,將不再使用的列資料從磁碟刪除共置NULL,從而達到降低儲存成本的目的。
命令格式
ALTER TABLE <table_name> [partition ( <pt_spec>[, <pt_spec>....] )]
CLEAR COLUMN column1[, column2, column3, ...]
[without touch];
參數說明
參數 | 是否必填 | 說明 |
table_name | 是 | 將要執行清空列資料的表名稱。 |
column | 是 | 將要被清空資料的列名稱。 |
partition | 否 | 指定分區,若未指定,則表示操作所有分區。 |
pt_spec | 否 | 分區描述,格式為(partition_col1 = partition_col_value1, partition_col2 = partition_col_value2, ...)。 |
without touch | 否 | 表示不更新LastDataModifiedTime;若未指定,則會更新LastDataModifiedTime。 |
使用樣本
-- 向sale_detail表增加分區
ALTER TABLE sale_detail ADD PARTITION (sale_date='2023', region='china') PARTITION (sale_date='2024', region='shanghai');
-- 向分區表中插入資料
INSERT INTO sale_detail PARTITION (sale_date='2023', region='china') VALUES ('s1','c1',100.1),('s2','c2',100.2),('s3','c3',100.3);
INSERT INTO sale_detail PARTITION (sale_date='2024', region='shanghai') VALUES ('null','c5',null),('s6','c6',100.4),('s7','c7',100.5);
-- 清空shop_name列
ALTER TABLE sale_detail partition(sale_date='2023', region='china') CLEAR COLUMN shop_name;
關於清空列資料的使用限制和樣本詳情請參見清空列資料。
查看錶資訊
查看MaxCompute內部表、外部表格、聚簇表或Transactional表的資訊。如果您需要查看錶的詳細資料資訊,請參見SELECT文法。
命令格式
查看錶資訊。
DESC <table_name> [PARTITION (<pt_spec>)];
查看外部表格、聚簇表或Transactional表資訊以及內部表的擴充資訊(例如列的非空屬性)。
--查看外部表格、聚簇表或Transactional表資訊。也可以查看內部表的擴充資訊。
DESC EXTENDED <table_name>;
參數說明
參數 | 是否必填 | 說明 |
table_name | 是 | 待查看錶的名稱。 |
pt_spec | 否 | 待查看分區表的指定分區。格式為(partition_col1 = partition_col_value1, partition_col2 = partition_col_value2, ...)。 |
使用樣本
查看建立的test1表的資訊。
DESC test1;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$maoXXX@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2020-11-16 17:47:48 |
| LastDDLTime: 2020-11-16 17:47:48 |
| LastModifiedTime: 2020-11-16 17:47:48 |
+------------------------------------------------------------------------------------+
| InternalTable: YES | Size: 0 |
+------------------------------------------------------------------------------------+
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | Comment |
+------------------------------------------------------------------------------------+
| key | string | | |
+------------------------------------------------------------------------------------+
查看建立的sale_detail表的資訊。
DESC sale_detail;
點擊展開查看執行結果
+--------------------------------------------------------------------+
| Owner: ALIYUN$maoXXX@alibaba-inc.com | Project: $project_name |
| TableComment: |
+--------------------------------------------------------------------+
| CreateTime: 2017-06-28 15:05:17 |
| LastDDLTime: 2017-06-28 15:05:17 |
| LastModifiedTime: 2017-06-28 15:05:17 |
+--------------------------------------------------------------------+
| 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 | |
+--------------------------------------------------------------------+
查看建立的sale_detail_ctas1表的詳細資料。
DESC extended sale_detail_ctas1;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$maoXXX@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2021-07-07 15:29:53 |
| LastDDLTime: 2021-07-07 15:29:53 |
| LastModifiedTime: 2021-07-07 15:29:53 |
| 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: 98cb8a38733c49eabed4735173818147 |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| StoredAs: AliOrc |
| CompressionStrategy: normal |
+------------------------------------------------------------------------------------+
sale_date和region兩個欄位僅會作為普通列存在,而不是表的分區。
查看建立的sale_detail_ctas2表的資訊。
DESC sale_detail_ctas2;
點擊展開查看執行結果
+--------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+--------------------------------------------------------------------+
| CreateTime: 2017-06-28 15:42:17 |
| LastDDLTime: 2017-06-28 15:42:17 |
| LastModifiedTime: 2017-06-28 15:42:17 |
+--------------------------------------------------------------------+
| InternalTable: YES | Size: 0 |
+--------------------------------------------------------------------+
| Native Columns: |
+--------------------------------------------------------------------+
| Field | Type | Label | Comment |
+--------------------------------------------------------------------+
| shop_name | string | | |
| customer_id | string | | |
| total_price | double | | |
| sale_date | string | | |
| region | string | | |
+--------------------------------------------------------------------+
查看建立的sale_detail_like表的詳細資料。
DESC extended sale_detail_like;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2021-07-07 15:40:38 |
| LastDDLTime: 2021-07-07 15:40:38 |
| LastModifiedTime: 2021-07-07 15:40:38 |
| 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 | |
+------------------------------------------------------------------------------------+
| Partition Columns: |
+------------------------------------------------------------------------------------+
| sale_date | string | |
| region | string | |
+------------------------------------------------------------------------------------+
| Extended Info: |
+------------------------------------------------------------------------------------+
| TableID: 61782ff7713f426e9d6f91d5deeac99a |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| StoredAs: AliOrc |
| CompressionStrategy: normal |
+------------------------------------------------------------------------------------+
除生命週期屬性外,sale_detail_like的其他屬性(欄位類型、分區類型等)均與sale_detail完全一致。
說明 通過DESC <table_name>;查看到的Size包含了在資源回收筒的資料Size。如果您需要清空資源回收筒,可以先執行PURGE TABLE <table_name>;,然後再執行DESC <table_name>;查看除資源回收筒以外的資料大小。您也可以執行SHOW recyclebin;查看本專案中資源回收筒內的資料明細。
查看建立的test_newtype表的資訊。
DESC test_newtype;
點擊展開查看執行結果
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | Comment |
+------------------------------------------------------------------------------------+
| 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) | | |
+------------------------------------------------------------------------------------+
OK
查看建立的Hash聚簇非分區表t1的資訊。聚簇屬性將顯示在Extended Info中。
DESC extended t1;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2020-11-16 18:00:56 |
| LastDDLTime: 2020-11-16 18:00:56 |
| LastModifiedTime: 2020-11-16 18:00:56 |
+------------------------------------------------------------------------------------+
| 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: e6b06f705dc34a36a5b72e5af486cab7 |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| StoredAs: AliOrc |
| CompressionStrategy: normal |
| ClusterType: hash |
| BucketNum: 1024 |
| ClusterColumns: [c] |
| SortColumns: [c ASC] |
+------------------------------------------------------------------------------------+
OK
查看建立的Hash聚簇分區表t2的資訊。聚簇屬性將顯示在Extended Info中。
DESC EXTENDED t2;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2017-12-25 11:18:26 |
| LastDDLTime: 2017-12-25 11:18:26 |
| LastModifiedTime: 2017-12-25 11:18:26 |
| Lifecycle: 2 |
+------------------------------------------------------------------------------------+
| InternalTable: YES | Size: 0 |
+------------------------------------------------------------------------------------+
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | Comment |
+------------------------------------------------------------------------------------+
| a | string | | |
| b | string | | |
| c | bigint | | |
+------------------------------------------------------------------------------------+
| Partition Columns: |
+------------------------------------------------------------------------------------+
| dt | string | |
+------------------------------------------------------------------------------------+
| Extended Info: |
+------------------------------------------------------------------------------------+
| TableID: 91a3395d3ef64b4d9ee1d2852755 |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| ClusterType: hash |
| BucketNum: 1024 |
| ClusterColumns: [c] |
| SortColumns: [c ASC] |
+------------------------------------------------------------------------------------+
OK
查看Range聚簇非分區表t3的資訊。聚簇屬性將顯示在Extended Info中。
DESC extended t3;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2020-11-16 18:01:05 |
| LastDDLTime: 2020-11-16 18:01:05 |
| LastModifiedTime: 2020-11-16 18:01:05 |
+------------------------------------------------------------------------------------+
| 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: 38d170aca2684f4baadbbe1931a6ae1f |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| StoredAs: AliOrc |
| CompressionStrategy: normal |
| ClusterType: range |
| BucketNum: 1024 |
| ClusterColumns: [c] |
| SortColumns: [c ASC] |
+------------------------------------------------------------------------------------+
OK
查看Range聚簇分區表t4的資訊。聚簇屬性將顯示在Extended Info中。
DESC extended t4;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@alibaba-inc.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2020-11-16 19:17:48 |
| LastDDLTime: 2020-11-16 19:17:48 |
| LastModifiedTime: 2020-11-16 19:17:48 |
+------------------------------------------------------------------------------------+
| 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: 6ebc3432e283449188c861427bcd6ee4 |
| IsArchived: false |
| PhysicalSize: 0 |
| FileNum: 0 |
| StoredAs: AliOrc |
| CompressionStrategy: normal |
| ClusterType: range |
| BucketNum: 0 |
| ClusterColumns: [c] |
| SortColumns: [c ASC] |
+------------------------------------------------------------------------------------+
OK
查看非分區表t5是否為Transactional表。
說明 推薦您使用MaxCompute用戶端查看錶是否為Transactional表,需要將MaxCompute用戶端升級到0.35.4或以上版本。其他工具可能會存在版本升級未就緒的問題,導致查詢結果不顯示Transactional資訊。
DESC extended t5;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@aliyun.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2021-02-18 10:56:27 |
| LastDDLTime: 2021-02-18 10:56:27 |
| LastModifiedTime: 2021-02-18 10:56:27 |
+------------------------------------------------------------------------------------+
| InternalTable: YES | Size: 0 |
+------------------------------------------------------------------------------------+
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | ExtendedLabel | Nullable | DefaultValue | Comment |
+------------------------------------------------------------------------------------+
| id | bigint | | | true | NULL | |
+------------------------------------------------------------------------------------+
| Extended Info: |
+------------------------------------------------------------------------------------+
...
| Transactional: true |
+------------------------------------------------------------------------------------+
查看分區表t6是否為Transactional表。
說明 推薦您使用MaxCompute用戶端查看錶是否為Transactional表,需要將MaxCompute用戶端升級到0.35.4或以上版本。其他工具可能會存在版本升級未就緒的問題,導致查詢結果不顯示Transactional資訊。
DESC extended t6;
點擊展開查看執行結果
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$xxxxx@test.aliyunid.com | Project: $project_name |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2021-02-18 15:34:54 |
| LastDDLTime: 2021-02-18 15:34:54 |
| LastModifiedTime: 2021-02-18 15:34:54 |
+------------------------------------------------------------------------------------+
| InternalTable: YES | Size: 0 |
+------------------------------------------------------------------------------------+
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | Comment |
+------------------------------------------------------------------------------------+
| id | bigint | | |
+------------------------------------------------------------------------------------+
| Partition Columns: |
+------------------------------------------------------------------------------------+
| ds | string | |
+------------------------------------------------------------------------------------+
| Extended Info: |
+------------------------------------------------------------------------------------+
...
| Transactional: true |
+------------------------------------------------------------------------------------+
查看建表語句
產生建立表的SQL DDL語句,方便您通過SQL重建Schema。
命令格式
SHOW CREATE TABLE <table_name>;
參數說明
table_name:必填。待查看建表語句的表的名稱。
使用樣本
-- 查看錶sale_detail的建表語句。
SHOW CREATE TABLE sale_detail;
返回結果如下。
CREATE TABLE IF NOT EXISTS max****.`default`.sale_detail(shop_name STRING, customer_id STRING, total_price DOUBLE)
PARTITIONED BY (sale_date STRING, region STRING) STORED AS ALIORC TBLPROPERTIES ('columnar.nested.type'='true');
列出專案下的表和視圖
列出專案下所有的表、外部表格、視圖和物化視圖,或符合某些規則的表、外部表格、視圖和物化視圖。
命令格式
-- 列出專案下所有的表和視圖。
SHOW TABLES;
-- 列出專案下表名或視圖名與chart匹配的表。
SHOW TABLES LIKE '<chart>';
使用樣本
-- 列出專案下表名與sale*匹配的表。*表示任意欄位。
SHOW TABLES LIKE 'sale*';
返回結果如下。
ALIYUN$account_name:sale_detail
......
--ALIYUN是系統提示符,表示您是阿里雲主帳號使用者。如果您是阿里雲RAM使用者,系統提示符為RAM。
列出專案下外部表格
列出專案下所有的外部表格,或符合某些規則的外部表格。
說明 SHOW EXTERNAL TABLES命令需要在MaxCompute用戶端(odpscmd)0.43.0及以上版本中執行。
命令格式
-- 列出專案下所有的外部表格。
SHOW EXTERNAL TABLES;
-- 列出專案下名稱與external_chart匹配的外部表格。
SHOW EXTERNAL TABLES LIKE '<external_chart>';
使用樣本
--列出專案下名稱與a*匹配的外部表格。*表示任意欄位。
SHOW EXTERNAL TABLES LIKE 'a*';
返回結果如下。
ALIYUN$account_name:a_et
......
--ALIYUN是系統提示符,表示您是阿里雲主帳號使用者。如果您是阿里雲RAM使用者,系統提示符為RAM。