このトピックでは、さまざまな操作でSHOWコマンドを使用する方法について説明します。
SHOWコマンドの使用方法を次の表に示します。
セクション | 説明 |
SETコマンドを使用して設定したプロパティを表示します。 | |
データのアップロードまたはダウンロードに使用されるコマンド、またはアップロードまたはダウンロード操作のログを表示します。 | |
プロジェクトのセキュリティ構成プロパティを表示します。 | |
MaxComputeプロジェクトで作成またはインストールされたパッケージを表示します。 | |
| |
| |
| |
インスタンスに関する情報を表示します。 この情報には、StartTime (秒までの精度) 、RunTime (秒単位) 、Status、InstanceID、Owner、およびQuery (クエリステートメント) が含まれます。 | |
ユーザーまたはロールの権限とオブジェクトに対する権限を照会します。 | |
列統計メトリックの収集結果をテストします。 |
SET操作
SETステートメントを使用して構成したプロパティを表示します。 構文:
show flags;SET操作の詳細については、「SET操作」をご参照ください。
トンネル操作
履歴レコードを表示します。
構文
tunnel show history [-n <number>];-n <number>: コマンドの実行回数を指定します。
例
例1: 履歴レコードの表示 デフォルトでは、500のデータレコードが保存されます。
tunnel show history;次の応答が返されます。
20230505xxxxxxxxxxxxxx0b0d5b3c bad 'upload d:\data.txt sale_detail/sale_date=201312,region=hangzhou -dbr true -time true' 20230505xxxxxxxxxxxxxx0ad720a3 failed 'upload d:\data.txt sale_detail/sale_date=201312,region=hangzhou -time true' 20230505xxxxxxxxxxxxxx0ad5ca68 bad 'upload d:\data.txt sale_detail/sale_date=201312,region=hangzhou -dbr true' ......例2: 過去5回のデータのアップロードまたはダウンロードで使用されたコマンドを表示します。
tunnel show history -n 5;次の応答が返されます。
20230505xxxxxxxxxxxxxx0aa48c4b success 'download sale_detail/sale_date=201312,region=hangzhou result.txt' 20230505xxxxxxxxxxxxxx0aa6165c success 'download sale_detail/sale_date=201312,region=hangzhou result.txt' 20230505xxxxxxxxxxxxxx0af11472 failed 'upload d:\data.txt sale_detail/sale_date=201312,region=hangzhou -s false' 20230505xxxxxxxxxxxxxx0b464374 success 'upload d:\data.txt sale_detail/sale_date=201312,region=hangzhou -s false' 20230505xxxxxxxxxxxxxx02dbb6bd failed 'upload d:\data.txt sale_detail/sale_date="201312",region="hangzhou" -s false'
前回のデータのアップロードまたはダウンロードのログを表示します。
tunnel show log;
Tunnelコマンドの詳細については、「Tunnelコマンド」をご参照ください。
セキュリティ操作
現在のプロジェクトのセキュリティ構成プロパティを表示します。
セキュリティ操作の詳細については、「セキュリティ操作」をご参照ください。
パッケージ操作
パッケージ作成者は、MaxComputeプロジェクトで作成またはインストールされたパッケージを表示します。
構文
show packages;例
test_project_aプロジェクトで作成またはインストールされたパッケージに関する情報を表示します。 サンプルコマンド:
-- View packages. show packages;返される結果には、次の情報が含まれます。
PackageName: 作成またはインストールされたパッケージの名前。
CreateTime: パッケージが作成された時刻。
SourceProject: パッケージが属するMaxComputeプロジェクトの名前。
InstallTime: パッケージがインストールされた時刻。
ステータス: パッケージのステータス。
+-------------+--------------------------+ | PackageName | CreateTime | +-------------+--------------------------+ | datashare | 2021-12-28T18:10:39+0800 | +-------------+--------------------------+ +-------------+--------------------+--------------------------+--------+ | PackageName | SourceProject | InstallTime | Status | +-------------+--------------------+--------------------------+--------+ | systables | information_schema | 2020-11-24T14:11:23+0800 | OK | +-------------+--------------------+--------------------------+--------+
パッケージ操作の詳細については、「パッケージに基づくプロジェクト間リソースアクセス」をご参照ください。
バックアップ操作
プロジェクト内の削除されたテーブルとバックアップ状態のテーブルを含むテーブルに関する情報を表示します。 テーブル名でテーブルをフィルタリングできます。 サンプルコマンド:
show history for tables [like <table_name>];指定されたテーブルのバックアップデータを表示し、保持期間内のデータバージョンに関する情報を取得します。
show history for table <table_name>;削除されたテーブルのバックアップデータを表示し、保持期間内のデータバージョンに関する情報を取得します。
show history for table table_name ('id'='xxxx');指定されたパーティションのバックアップデータを表示し、保持期間内のデータバージョンに関する情報を取得します。
show history for table table_name partition_spec;削除されたパーティションのバックアップデータを表示し、保持期間内のデータバージョンに関する情報を取得します。 idの値は、
show history for table <table_name>;コマンドの出力のObjectIdフィールドから取得できます。show history for table table_name PARTITION('id'='xxxx');
バックアップと復元コマンドの詳細については、「バックアップと復元」をご参照ください。
テーブル操作
CREATE TABLEステートメントを表示します。
構文
show create table <table_name>;パラメーター
table_name: 必須です。 CREATE tableステートメントを表示するテーブルの名前。
例:
-- View the CREATE TABLE statement that is used to create the sale_detail table. show create table sale_detail;次の応答が返されます。
CREATE TABLE IF NOT EXISTS doc_test_dev.sale_detail(shop_name STRING,customer_id STRING,total_price DOUBLE) PARTITIONED BY (sale_date STRING,region STRING) STORED AS ALIORC;
プロジェクト内の特定のルールを満たすすべてのオブジェクトまたはオブジェクトを表示します。 オブジェクトには、テーブル、外部テーブル、ビュー、およびマテリアライズドビューが含まれます。
構文
-- View all objects or objects that meet specific rules in a project. The objects include tables, external tables, views, and materialized views. show tables; -- View the tables, external tables, views, and materialized views whose names match the condition specified by chart in a project. show tables like '<chart>';例
-- View the tables, external tables, views, and materialized views whose names match the sale* keyword in a project. The asterisk (*) indicates any character. show tables like 'sale*';次の応答が返されます。
ALIYUN$account_name:sale_detail ...... -- ALIYUN is a system prompt, which indicates that the table is created by using an Alibaba Cloud account. If the table was created by a RAM user, the system prompt is RAM.
プロジェクト内の特定のルールを満たすすべての外部テーブルまたは外部テーブルを表示します。
構文
-- View all external tables in a project. show external tables; -- View the external tables whose names match the condition specified by external_chart in a project. show external tables like '<external_chart>';例
-- View the external tables whose names match the a* keyword in a project. The asterisk (*) indicates any character. show external tables like 'a*';次の応答が返されます。
ALIYUN$account_name:a_et ...... -- ALIYUN is a system prompt, which indicates that the table is created by using an Alibaba Cloud account. If the table was created by a RAM user, the system prompt is RAM.
説明show external tables;コマンドを実行できるのは、MaxComputeクライアント (odpscmd) V0.43.0以降のみです。プロジェクト内のすべてのビューまたは特定のルールを満たすビューを表示します。
構文
-- View all views in a project. show views; -- View the views whose names match the condition specified by view in a project. show views like '<view>';例
-- View the views whose names match the mf* keyword in a project. The asterisk (*) indicates any character. show views like 'mf*';次の応答が返されます。
ALIYUN$account_name:mf_v ...... -- ALIYUN is a system prompt, which indicates that the table is created by using an Alibaba Cloud account. If the table was created by a RAM user, the system prompt is RAM.
説明show views;コマンドを実行できるのは、MaxComputeクライアント (odpscmd) V0.43.0以降のみです。プロジェクト内の特定のルールを満たすすべてのマテリアライズドビューまたはマテリアライズドビューを表示します。
構文
-- View all materialized views in a project. show materialized views; -- View the materialized views whose names match the condition specified by materialized_view in a project. show materialized views like '<materialized_view>';例
-- View the materialized views whose names match the test* keyword in a project. The asterisk (*) indicates any character. show materialized views like 'test*';次の応答が返されます。
ALIYUN$account_name:test_two_mv ALIYUN$account_name:test_create_one_mv ...... -- ALIYUN is a system prompt, which indicates that the table is created by using an Alibaba Cloud account. If the table was created by a RAM user, the system prompt is RAM.
説明showマテリアライズド・ビュー;コマンドを実行できるのは、MaxComputeクライアント (odpscmd) V0.43.0以降のみです。テーブルのすべてのパーティションを表示します。 テーブルが存在しないか、テーブルがパーティション分割されていないテーブルである場合、エラーが返されます。
構文
show partitions <table_name>;パラメーター
table_name: 必須です。 パーティション情報を表示するパーティションテーブルの名前。
例
-- Display all the partitions of the sale_detail table. show partitions sale_detail;次の応答が返されます。
sale_date=201310/region=beijing sale_date=201312/region=shenzhen sale_date=201312/region=xian sale_date=2014/region=shenzhen OK
テーブル操作の詳細については、「テーブル操作」をご参照ください。
関数の操作
MaxComputeプロジェクト内のすべてのUDFの情報を表示します。
構文次のいずれかの構文を使用して、MaxComputeプロジェクト内のすべてのUDFを表示できます。
list functions [-p <project_name>];show functions;
パラメーター
project_name: オプションです。 MaxComputeプロジェクトの名前。
例:
list functions;次の応答が返されます。
Name Owner Create Time Class Resources ipv4_ipv6_aton ALIYUN$****@aliyun.com 2021-11-15 13:42:14 com.aliyun.odps.udf.udfFunction.IpLocation ipv4.txt,ipv6.txt,udf-1.0-SNAPSHOT.jar Lower_test ALIYUN$****@aliyun.com 2021-08-25 15:51:22 com.aliyun.odps.udf.example.Lower udf-1.0-SNAPSHOT.jar my_add ALIYUN$****@aliyun.com 2021-05-08 11:26:02 my_index ALIYUN$****@aliyun.com 2021-08-25 12:01:05 com.aliyun.odps.examples.udf.UdfArray udf-1.0-SNAPSHOT.jar my_sum ALIYUN$****@aliyun.com 2021-05-08 10:24:58 my_udtf ALIYUN$****@aliyun.com 2021-02-23 11:37:30 com.aliyun.odps.examples.udf.UDTFResource udf-1.0-SNAPSHOT.jar numpy ALIYUN$****@aliyun.com 2020-11-11 14:12:50 numpy.TryImport numpy.py,numpy-1.19.4-cp37-cp37m-manylinux1_x86_64.zip ST_Aggr_ConvexHull ALIYUN$****@aliyun.com 2021-03-18 17:06:29 com.esri.hadoop.hive.ST_Aggr_ConvexHull esri-geometry-api.jar,spatial-sdk-hive.jar ST_Aggr_Intersection ALIYUN$****@aliyun.com 2021-03-18 17:06:29 com.esri.hadoop.hive.ST_Aggr_Intersection esri-geometry-api.jar,spatial-sdk-hive.jar ST_Aggr_Union ALIYUN$****@aliyun.com 2021-03-18 17:06:30 com.esri.hadoop.hive.ST_Aggr_Union esri-geometry-api.jar,spatial-sdk-hive.jar ST_Area ALIYUN$****@aliyun.com 2021-03-18 17:06:30 com.esri.hadoop.hive.ST_Area esri-geometry-api.jar,spatial-sdk-hive.jar ST_AsBinary ALIYUN$****@aliyun.com 2021-03-18 17:06:30 com.esri.hadoop.hive.ST_AsBinary esri-geometry-api.jar,spatial-sdk-hive.jar ST_AsGeoJson ALIYUN$****@aliyun.com 2021-03-18 17:06:49 com.esri.hadoop.hive.ST_AsGeoJson esri-geometry-api.jar,spatial-sdk-hive.jar ST_AsJson ALIYUN$****@aliyun.com 2021-03-18 17:06:50 com.esri.hadoop.hive.ST_AsJson esri-geometry-api.jar,spatial-sdk-hive.jar ST_AsShape ALIYUN$****@aliyun.com 2021-03-18 17:06:50 com.esri.hadoop.hive.ST_AsShape esri-geometry-api.jar,spatial-sdk-hive.jar ST_AsText ALIYUN$****@aliyun.com 2021-03-18 17:06:50 com.esri.hadoop.hive.ST_AsText esri-geometry-api.jar,spatial-sdk-hive.jar ST_Bin ALIYUN$****@aliyun.com 2021-03-18 17:06:50 com.esri.hadoop.hive.ST_Bin esri-geometry-api.jar,spatial-sdk-hive.jar ST_BinEnvelope ALIYUN$****@aliyun.com 2021-03-18 17:07:01 com.esri.hadoop.hive.ST_BinEnvelope esri-geometry-api.jar,spatial-sdk-hive.jar ST_Boundary ALIYUN$****@aliyun.com 2021-03-18 17:07:01 com.esri.hadoop.hive.ST_Boundary esri-geometry-api.jar,spatial-sdk-hive.jar ST_Buffer ALIYUN$****@aliyun.com 2021-03-18 17:07:01 com.esri.hadoop.hive.ST_Buffer esri-geometry-api.jar,spatial-sdk-hive.jar ST_Centroid ALIYUN$****@aliyun.com 2021-03-18 17:07:01 com.esri.hadoop.hive.ST_Centroid esri-geometry-api.jar,spatial-sdk-hive.jar ST_Contains ALIYUN$****@aliyun.com 2021-03-18 17:07:01 com.esri.hadoop.hive.ST_Contains esri-geometry-api.jar,spatial-sdk-hive.jar ST_ConvexHull ALIYUN$****@aliyun.com 2021-03-18 17:07:13 com.esri.hadoop.hive.ST_ConvexHull esri-geometry-api.jar,spatial-sdk-hive.jar ST_CoordDim ALIYUN$****@aliyun.com 2021-03-18 17:07:14 com.esri.hadoop.hive.ST_CoordDim esri-geometry-api.jar,spatial-sdk-hive.jar ST_Crosses ALIYUN$****@aliyun.com 2021-03-18 17:07:14 com.esri.hadoop.hive.ST_Crosses esri-geometry-api.jar,spatial-sdk-hive.jar ST_Difference ALIYUN$****@aliyun.com 2021-03-18 17:07:14 com.esri.hadoop.hive.ST_Difference esri-geometry-api.jar,spatial-sdk-hive.jar ST_Dimension ALIYUN$****@aliyun.com 2021-03-18 17:07:14 com.esri.hadoop.hive.ST_Dimension esri-geometry-api.jar,spatial-sdk-hive.jar ST_Disjoint ALIYUN$****@aliyun.com 2021-03-18 17:07:31 com.esri.hadoop.hive.ST_Disjoint esri-geometry-api.jar,spatial-sdk-hive.jar ST_Distance ALIYUN$****@aliyun.com 2021-03-18 17:07:31 com.esri.hadoop.hive.ST_Distance esri-geometry-api.jar,spatial-sdk-hive.jar ST_EndPoint ALIYUN$****@aliyun.com 2021-03-18 17:07:31 com.esri.hadoop.hive.ST_EndPoint esri-geometry-api.jar,spatial-sdk-hive.jar ST_Envelope ALIYUN$****@aliyun.com 2021-03-18 17:07:32 com.esri.hadoop.hive.ST_Envelope esri-geometry-api.jar,spatial-sdk-hive.jar ST_EnvIntersects ALIYUN$****@aliyun.com 2021-03-18 17:07:32 com.esri.hadoop.hive.ST_EnvIntersects esri-geometry-api.jar,spatial-sdk-hive.jar ST_Equals ALIYUN$****@aliyun.com 2021-03-18 17:07:44 com.esri.hadoop.hive.ST_Equals esri-geometry-api.jar,spatial-sdk-hive.jar ST_ExteriorRing ALIYUN$****@aliyun.com 2021-03-18 17:07:44 com.esri.hadoop.hive.ST_ExteriorRing esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeodesicLengthWGS84 ALIYUN$****@aliyun.com 2021-03-18 17:07:44 com.esri.hadoop.hive.ST_GeodesicLengthWGS84 esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomCollection ALIYUN$****@aliyun.com 2021-03-18 17:07:44 com.esri.hadoop.hive.ST_GeomCollection esri-geometry-api.jar,spatial-sdk-hive.jar ST_Geometry ALIYUN$****@aliyun.com 2021-03-18 17:07:44 com.esri.hadoop.hive.ST_Geometry esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeometryN ALIYUN$****@aliyun.com 2021-03-18 17:07:55 com.esri.hadoop.hive.ST_GeometryN esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeometryType ALIYUN$****@aliyun.com 2021-03-18 17:07:55 com.esri.hadoop.hive.ST_GeometryType esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomFromGeoJson ALIYUN$****@aliyun.com 2021-03-18 17:07:55 com.esri.hadoop.hive.ST_GeomFromGeoJson esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomFromJson ALIYUN$****@aliyun.com 2021-03-18 17:07:55 com.esri.hadoop.hive.ST_GeomFromJson esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomFromShape ALIYUN$****@aliyun.com 2021-03-18 17:07:56 com.esri.hadoop.hive.ST_GeomFromShape esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomFromText ALIYUN$****@aliyun.com 2021-03-18 17:08:10 com.esri.hadoop.hive.ST_GeomFromText esri-geometry-api.jar,spatial-sdk-hive.jar ST_GeomFromWKB ALIYUN$****@aliyun.com 2021-03-18 17:08:10 com.esri.hadoop.hive.ST_GeomFromWKB esri-geometry-api.jar,spatial-sdk-hive.jar
説明show functions;コマンドを実行できるのは、MaxComputeクライアント (odpscmd) V0.43.0以降のみです。MaxComputeプロジェクトの特定のルールを満たすすべての組み込み関数または組み込み関数の情報を表示します。
構文
-- View all built-in functions in a project. show builtin functions; -- Query the built-in function named <function_name> in the project. show builtin functions [<function_name>]; -- View the built-in functions whose names are the same as the value of <function_name> in a project. The asterisk (*) indicates any character. show builtin functions like '<function_name>';例
例 1:
show builtin functions;次の応答が返されます。
ID = 20230307081023424gef2hwowr1 ::ABS SCALAR DECIMAL(?,?) ABS(DECIMAL(?,?) arg0),DOUBLE ABS(DOUBLE arg0),BIGINT ABS(BIGINT arg0),INT ABS(INT arg0) ::ACOS SCALAR DOUBLE ACOS(DOUBLE arg0),DOUBLE ACOS(DECIMAL(?,?) arg0) ::ADD_MONTHS SCALAR STRING ADD_MONTHS(DATE arg0, BIGINT arg1),STRING ADD_MONTHS(TIMESTAMP arg0, BIGINT arg1),STRING ADD_MONTHS(STRING arg0, BIGINT arg1) ::ALL_MATCH SCALAR BOOLEAN ALL_MATCH(ARRAY<T> arg0, java.util.function.Function<T, java.lang.Boolean> arg1) ::ANY_MATCH SCALAR BOOLEAN ANY_MATCH(ARRAY<T> arg0, java.util.function.Function<T, java.lang.Boolean> arg1) ::ANY_VALUE AGGREGATOR T ANY_VALUE([DISTINCT] T arg1) ::APPROX_DISTINCT AGGREGATOR BIGINT APPROX_DISTINCT([DISTINCT] P arg1, DOUBLE arg2),BIGINT APPROX_DISTINCT([DISTINCT] P arg1) ::ARG_MAX AGGREGATOR R ARG_MAX([DISTINCT] T arg1, R arg2) ::ARG_MIN AGGREGATOR R ARG_MIN([DISTINCT] T arg1, R arg2) ::ARRAY SCALAR ARRAY<STRING> ARRAY(),ARRAY<T> ARRAY(T arg0...) ::ARRAYS_OVERLAP SCALAR BOOLEAN ARRAYS_OVERLAP(ARRAY<T> arg0, ARRAY<T> arg1) ::ARRAYS_ZIP SCALAR null ::ARRAY_CONTAINS SCALAR BOOLEAN ARRAY_CONTAINS(ARRAY<T> arg0, T arg1) ::ARRAY_DISTINCT SCALAR ARRAY<T> ARRAY_DISTINCT(ARRAY<T> arg0) ::ARRAY_EXCEPT SCALAR ARRAY<T> ARRAY_EXCEPT(ARRAY<T> arg0, ARRAY<T> arg1) ::ARRAY_INTERSECT SCALAR null ::ARRAY_JOIN SCALAR STRING ARRAY_JOIN(ARRAY<STRING> arg0, STRING arg1, STRING arg2),STRING ARRAY_JOIN(ARRAY<STRING> arg0, STRING arg1) ::ARRAY_MAX SCALAR T ARRAY_MAX(ARRAY<T> arg0) ::ARRAY_MIN SCALAR T ARRAY_MIN(ARRAY<T> arg0) ::ARRAY_NORMALIZE SCALAR ARRAY<FLOAT> ARRAY_NORMALIZE(ARRAY<FLOAT> arg0, FLOAT arg1),ARRAY<DOUBLE> ARRAY_NORMALIZE(ARRAY<DOUBLE> arg0, DOUBLE arg1) ::ARRAY_POSITION SCALAR BIGINT ARRAY_POSITION(ARRAY<T> arg0, T arg1, BIGINT arg2),BIGINT ARRAY_POSITION(ARRAY<T> arg0, T arg1) ::ARRAY_REDUCE SCALAR OUT ARRAY_REDUCE(ARRAY<IN> arg0, BUF arg1, java.util.function.BiFunction<BUF, IN, BUF> arg2, java.util.function.Function<BUF, OUT> arg3) ::ARRAY_REMOVE SCALAR ARRAY<T> ARRAY_REMOVE(ARRAY<T> arg0, T arg1) ::ARRAY_REPEAT SCALAR ARRAY<T> ARRAY_REPEAT(T arg0, BIGINT arg1) ::ARRAY_SORT SCALAR ARRAY<T> ARRAY_SORT(ARRAY<T> arg0, java.util.function.BiFunction<T, T, java.lang.Long> arg1) ::ARRAY_UNION SCALAR ARRAY<T> ARRAY_UNION(ARRAY<T> arg0, ARRAY<T> arg1) ::ASCII SCALAR BIGINT ASCII(STRING arg0) ::ASIN SCALAR DOUBLE ASIN(DOUBLE arg0),DOUBLE ASIN(DECIMAL(?,?) arg0) ::ATAN SCALAR DOUBLE ATAN(DECIMAL(?,?) arg0),DOUBLE ATAN(DOUBLE arg0) ::ATAN2 SCALAR DOUBLE ATAN2(DECIMAL(?,?) arg0, DECIMAL(?,?) arg1),DOUBLE ATAN2(DOUBLE arg0, DOUBLE arg1) ::AVG AGGREGATOR DECIMAL(?,?) AVG([DISTINCT] DECIMAL(?,?) arg1),DOUBLE AVG([DISTINCT] DOUBLE arg1) ::AVG WINDOW DOUBLE AVG([DISTINCT] DOUBLE arg0),DECIMAL(?,?) AVG([DISTINCT] DECIMAL(?,?) arg0) ::BASE64 SCALAR STRING BASE64(BINARY arg0) ::BIN SCALAR STRING BIN(BIGINT arg0) ::BITAND SCALAR BIGINT BITAND(BIGINT arg0, BIGINT arg1) ::BITNOT SCALAR BIGINT BITNOT(BIGINT arg0) ::BITOR SCALAR BIGINT BITOR(BIGINT arg0, BIGINT arg1) ::BITWISE_AND_AGG AGGREGATOR BIGINT BITWISE_AND_AGG([DISTINCT] BIGINT arg1) ::BITWISE_OR_AGG AGGREGATOR BIGINT BITWISE_OR_AGG([DISTINCT] BIGINT arg1) ::BITXOR SCALAR BIGINT BITXOR(BIGINT arg0, BIGINT arg1) ::BROUND SCALAR DOUBLE BROUND(DOUBLE arg0, BIGINT arg1),DOUBLE BROUND(DOUBLE arg0) ......説明show builtin functions;コマンドを実行できるのは、MaxComputeクライアント (odpscmd) V0.43.0以降のみです。例 2:
-- Query the built-in function named abs in the project. show builtin functions abs;次の応答が返されます。
ID = 20230307085650740gm4qqqk6dox5 ::ABS SCALAR DOUBLE ABS(DOUBLE arg0),DECIMAL(?,?) ABS(DECIMAL(?,?) arg0),BIGINT ABS(BIGINT arg0),INT ABS(INT arg0)例 3:
-- View the built-in functions whose names match the a* keyword in a project. The asterisk (*) indicates any character. show builtin functions like 'a*';次の応答が返されます。
ID = 20230307085929584g784o0q9z8d1 ::ABS SCALAR INT ABS(INT arg0),DOUBLE ABS(DOUBLE arg0),BIGINT ABS(BIGINT arg0),DECIMAL(?,?) ABS(DECIMAL(?,?) arg0) ::ACOS SCALAR DOUBLE ACOS(DOUBLE arg0),DOUBLE ACOS(DECIMAL(?,?) arg0) ::ADD_MONTHS SCALAR STRING ADD_MONTHS(STRING arg0, BIGINT arg1),STRING ADD_MONTHS(TIMESTAMP arg0, BIGINT arg1),STRING ADD_MONTHS(DATE arg0, BIGINT arg1) ::ALL_MATCH SCALAR BOOLEAN ALL_MATCH(ARRAY<T> arg0, java.util.function.Function<T, java.lang.Boolean> arg1) ::ANY_MATCH SCALAR BOOLEAN ANY_MATCH(ARRAY<T> arg0, java.util.function.Function<T, java.lang.Boolean> arg1) ::ANY_VALUE AGGREGATOR T ANY_VALUE([DISTINCT] T arg1) ::APPROX_DISTINCT AGGREGATOR BIGINT APPROX_DISTINCT([DISTINCT] P arg1, DOUBLE arg2),BIGINT APPROX_DISTINCT([DISTINCT] P arg1) ::ARG_MAX AGGREGATOR R ARG_MAX([DISTINCT] T arg1, R arg2) ::ARG_MIN AGGREGATOR R ARG_MIN([DISTINCT] T arg1, R arg2) ::ARRAY SCALAR ARRAY<T> ARRAY(T arg0...),ARRAY<STRING> ARRAY() ::ARRAYS_OVERLAP SCALAR BOOLEAN ARRAYS_OVERLAP(ARRAY<T> arg0, ARRAY<T> arg1) ::ARRAYS_ZIP SCALAR null ::ARRAY_CONTAINS SCALAR BOOLEAN ARRAY_CONTAINS(ARRAY<T> arg0, T arg1) ::ARRAY_DISTINCT SCALAR ARRAY<T> ARRAY_DISTINCT(ARRAY<T> arg0) ::ARRAY_EXCEPT SCALAR ARRAY<T> ARRAY_EXCEPT(ARRAY<T> arg0, ARRAY<T> arg1) ::ARRAY_INTERSECT SCALAR null ::ARRAY_JOIN SCALAR STRING ARRAY_JOIN(ARRAY<STRING> arg0, STRING arg1, STRING arg2),STRING ARRAY_JOIN(ARRAY<STRING> arg0, STRING arg1) ::ARRAY_MAX SCALAR T ARRAY_MAX(ARRAY<T> arg0) ::ARRAY_MIN SCALAR T ARRAY_MIN(ARRAY<T> arg0) ::ARRAY_NORMALIZE SCALAR ARRAY<FLOAT> ARRAY_NORMALIZE(ARRAY<FLOAT> arg0, FLOAT arg1),ARRAY<DOUBLE> ARRAY_NORMALIZE(ARRAY<DOUBLE> arg0, DOUBLE arg1) ::ARRAY_POSITION SCALAR BIGINT ARRAY_POSITION(ARRAY<T> arg0, T arg1, BIGINT arg2),BIGINT ARRAY_POSITION(ARRAY<T> arg0, T arg1) ::ARRAY_REDUCE SCALAR OUT ARRAY_REDUCE(ARRAY<IN> arg0, BUF arg1, java.util.function.BiFunction<BUF, IN, BUF> arg2, java.util.function.Function<BUF, OUT> arg3) ::ARRAY_REMOVE SCALAR ARRAY<T> ARRAY_REMOVE(ARRAY<T> arg0, T arg1) ::ARRAY_REPEAT SCALAR ARRAY<T> ARRAY_REPEAT(T arg0, BIGINT arg1) ::ARRAY_SORT SCALAR ARRAY<T> ARRAY_SORT(ARRAY<T> arg0, java.util.function.BiFunction<T, T, java.lang.Long> arg1) ::ARRAY_UNION SCALAR ARRAY<T> ARRAY_UNION(ARRAY<T> arg0, ARRAY<T> arg1) ::ASCII SCALAR BIGINT ASCII(STRING arg0) ::ASIN SCALAR DOUBLE ASIN(DECIMAL(?,?) arg0),DOUBLE ASIN(DOUBLE arg0) ::ATAN SCALAR DOUBLE ATAN(DECIMAL(?,?) arg0),DOUBLE ATAN(DOUBLE arg0) ::ATAN2 SCALAR DOUBLE ATAN2(DECIMAL(?,?) arg0, DECIMAL(?,?) arg1),DOUBLE ATAN2(DOUBLE arg0, DOUBLE arg1) ::AVG AGGREGATOR DECIMAL(?,?) AVG([DISTINCT] DECIMAL(?,?) arg1),DOUBLE AVG([DISTINCT] DOUBLE arg1) ::AVG WINDOW DOUBLE AVG([DISTINCT] DOUBLE arg0),DECIMAL(?,?) AVG([DISTINCT] DECIMAL(?,?) arg0)
関数操作の詳細については、「関数操作」をご参照ください。
インスタンス操作
インスタンス情報を表示します。 情報には、StartTime (秒単位) 、RunTime (秒単位) 、Status、InstanceID、Owner、およびQueryステートメントが含まれます。
構文
show p|proc|processlist|instances [from <startdate>] [to <enddate>] [-p <project_name>] [-limit <number> | <number>] [-all]; ls|list instances [from <startdate>] [to <enddate>] [-p <project_name>] [-limit <number> | <number>] [-all];show p、show proc、show processlist、show instances、ls instances、およびlist instancesと同等のステートメントです。パラメーター
startdateおよびenddate: オプションです。 startdateからenddateまでの期間内にユーザーによって送信されたインスタンス情報が返されます。 startdateパラメーターで指定する日付は、enddateパラメーターで指定する日付より前である必要があります。 終了日で指定された日に送信されたインスタンス情報は含まれません。 2つのパラメーターの値は、
yyyy-mm-dd形式である必要があります。 パラメーターを設定しない場合、当日に送信されたインスタンス情報が返されます。project_name: オプションです。 クエリするインスタンスが属するMaxComputeプロジェクトの名前。 MaxComputeプロジェクトのインスタンスを表示する権限が必要です。 このパラメーターを設定しない場合、現在のMaxComputeプロジェクトのインスタンスが照会されます。
number: オプション。 返すインスタンスの数。
このパラメーターを設定すると、現在時刻に最も近い時刻に送信されたN個のインスタンスに関する情報が時系列で返されます。 Nはnumberパラメーターで指定します。 このパラメーターを設定しない場合、特定の要件を満たすインスタンスに関する情報が返されます。
-limit <number>とnumberは同等です。-all: オプション。 MaxComputeプロジェクトのメンバーによって実行されるすべてのインスタンスに関する情報が返されます。 このパラメーターを設定しない場合、MaxComputeプロジェクトで現在のユーザーによって実行されているインスタンスに関する情報が返されます。
numberパラメーターが指定されていない場合、デフォルトで最大50個のインスタンスに関する情報が返されます。 numberパラメーターが設定されている場合、N個のインスタンスに関する情報が返されます。 Nはnumberパラメーターで指定します。
例
例1: 当日に現在のMaxComputeプロジェクトで現在のユーザーによって実行されているすべてのインスタンスに関する情報を表示します。 例:
show p;次の応答が返されます。
StartTime RunTime Status InstanceID Owner Query 2021-09-14 11:43:04 0s Success 20210914**************3rw2 ALIYUN$****@test.aliyunid.com 2021-09-14 11:43:05 1s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com select date_sub(datetime '2005-03-01 00:00:00', 1); 2021-09-14 11:58:13 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com 2021-09-14 11:58:15 1s Success 20210914**************5qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2005-02-28', -1); 2021-09-14 12:02:15 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2008-03-01 00:00:00', 2); 2021-09-14 12:02:15 0s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:31 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:32 0s Success 20210914**************euq2 ALIYUN$****@test.aliyunid.com select date_sub('2005-03-01 00:00:00', 2); 2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com 2021-09-14 13:35:43 0s Success 20210914**************j8o7 ALIYUN$****@test.aliyunid.com select date_sub(getdate(),1); 2021-09-14 13:40:40 1s Success 20210914**************h3wz ALIYUN$****@test.aliyunid.com select date_sub(getdate(),0); 2021-09-14 13:40:40 0s Success 20210914**************9nm7 ALIYUN$****@test.aliyunid.com 12 instances例2: 指定された期間内に現在のMaxComputeプロジェクトで現在のユーザーによって実行されたインスタンスに関する情報を表示し、情報を照会するインスタンスの数を指定します。 例:
show instances from 2021-09-14 to 2021-09-15 -limit 10;次の応答が返されます。
StartTime RunTime Status InstanceID Owner Query 2021-09-14 11:58:13 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com 2021-09-14 11:58:15 1s Success 20210914**************5qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2005-02-28', -1); 2021-09-14 12:02:15 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2008-03-01 00:00:00', 2); 2021-09-14 12:02:15 0s Success 20210914**************5t32 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:31 0s Success 20210914**************5pr2 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:32 0s Success 20210914**************euq2 ALIYUN$****@test.aliyunid.com select date_sub('2005-03-01 00:00:00', 2); 2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com 2021-09-14 13:35:43 0s Success 20210914**************j8o7 ALIYUN$****@test.aliyunid.com select date_sub(getdate(),1); 2021-09-14 13:40:40 1s Success 20210914**************h3wz ALIYUN$****@test.aliyunid.com select date_sub(getdate(),0); 2021-09-14 13:40:40 0s Success 20210914**************9nm7 ALIYUN$****@test.aliyunid.com 10 instances例3: 指定された期間内に別のMaxComputeプロジェクト内のすべてのユーザーによって実行されたインスタンスに関する情報を表示し、情報を照会するインスタンスの数を指定します。 例:
ls instances from 2021-09-14 to 2021-09-15 -p doc_test_dev -all -limit 10;次の応答が返されます。
StartTime RunTime Status InstanceID Owner Query 2021-09-14 11:59:16 0s Success 20210914**************6pr3 ALIYUN$****@test.aliyunid.com 2021-09-14 11:59:20 1s Success 20210914**************6qgr ALIYUN$****@test.aliyunid.com select date_sub(date '2007-02-26', -1); 2021-09-14 12:02:19 1s Success 20210914**************h8o7 ALIYUN$****@test.aliyunid.com select date_sub('2009-03-01 00:00:00', 2); 2021-09-14 12:02:25 0s Success 20210914**************7t42 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:37 0s Success 20210914**************7pr2 ALIYUN$****@test.aliyunid.com 2021-09-14 12:02:40 0s Success 20210914**************emq2 ALIYUN$****@test.aliyunid.com select date_sub('2015-03-01 00:00:00', 2); 2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com 2021-09-14 13:35:43 0s Success 20210914**************68o7 ALIYUN$kiki select date_sub(getdate(),1); 2021-09-14 13:45:40 1s Success 20210914**************73wz ALIYUN$kiki select date_sub(getdate(),0); 2021-09-14 13:45:45 0s Success 20210914**************9nm7 ALIYUN$dreak 10 instances例4: 当日に別のMaxComputeプロジェクト内のすべてのユーザーによって実行されているインスタンスに関する情報を表示し、情報を照会するインスタンスの数を指定します。 例:
show p -p doc_test_dev -all 5;次の応答が返されます。
StartTime RunTime Status InstanceID Owner Query 2021-09-14 12:02:40 0s Success 20210914**************emq2 ALIYUN$****@test.aliyunid.com select date_sub('2015-03-01 00:00:00', 2); 2021-09-14 13:35:42 0s Success 20210914**************1ms2 ALIYUN$****@test.aliyunid.com 2021-09-14 13:35:43 0s Success 20210914**************68o7 ALIYUN$kiki select date_sub(getdate(),1); 2021-09-14 13:45:40 1s Success 20210914**************73wz ALIYUN$kiki select date_sub(getdate(),0); 2021-09-14 13:45:45 0s Success 20210914**************9nm7 ALIYUN$dreak 5 instances
インスタンス操作の詳細については、「インスタンス操作」をご参照ください。
権限クエリ操作
MaxComputeでは、SHOWコマンドを使用して、ユーザーまたはロールの権限、またはオブジェクトに対する権限を照会できます。 詳細については、「MaxCompute SQLを使用したアクセス許可の照会」または「Permission-related command set」をご参照ください。
MaxComputeのオプティマイザに関する情報を収集するために実行できる操作
show statisticsコマンドを実行して、列統計メトリックの収集結果をテストできます。
例
-- Test the collection result of the tinyint1 column. show statistic analyze2_test columns (tinyint1); -- Test the collection results of the smallint1, string1, boolean1, and timestamp1 columns. show statistic analyze2_test columns (smallint1, string1, boolean1, timestamp1); -- Test the collection results of all columns. show statistic analyze2_test columns;返される結果
-- Collection result of the tinyint1 column: ID = 20201126085225150gnqo**** tinyint1:MaxValue: 20 -- The value of max. tinyint1:DistinctNum: 4.0 -- The value of ndv. tinyint1:MinValue: 1 -- The value of min. tinyint1:NullNum: 1.0 -- The value of nNulls. tinyint1:TopK: {1=1.0, 10=1.0, 20=1.0} -- The value of topK. 10=1.0 indicates that the occurrence frequency of column value 10 is 1. Up to 20 values with the highest occurrence frequency can be returned. -- Collection results of the smallint1, string1, boolean1, and timestamp1 columns: ID = 20201126091636149gxgf**** smallint1:MaxValue: 20 smallint1:DistinctNum: 4.0 smallint1:MinValue: 2 smallint1:NullNum: 1.0 smallint1:TopK: {2=1.0, 7=1.0, 20=1.0} string1:MaxLength 6.0 -- The value of maxColLen. string1:AvgLength: 3.0 -- The value of avgColLen. string1:DistinctNum: 4.0 string1:NullNum: 1.0 string1:TopK: {str1=1.0, str12=1.0, str123=1.0} boolean1:DistinctNum: 3.0 boolean1:NullNum: 1.0 boolean1:TopK: {false=2.0, true=1.0} timestamp1:DistinctNum: 3.0 timestamp1:NullNum: 1.0 timestamp1:TopK: {2018-09-17 00:00:00.0=2.0, 2018-09-18 00:00:00.0=1.0} -- Collection results of all columns: ID = 20201126092022636gzm1**** tinyint1:MaxValue: 20 tinyint1:DistinctNum: 4.0 tinyint1:MinValue: 1 tinyint1:NullNum: 1.0 tinyint1:TopK: {1=1.0, 10=1.0, 20=1.0} smallint1:MaxValue: 20 smallint1:DistinctNum: 4.0 smallint1:MinValue: 2 smallint1:NullNum: 1.0 smallint1:TopK: {2=1.0, 7=1.0, 20=1.0} int1:MaxValue: 7 int1:DistinctNum: 3.0 int1:MinValue: 4 int1:NullNum: 1.0 int1:TopK: {4=2.0, 7=1.0} bigint1:MaxValue: 11111118 bigint1:DistinctNum: 4.0 bigint1:MinValue: 8 bigint1:NullNum: 1.0 bigint1:TopK: {8=1.0, 2222228=1.0, 11111118=1.0} double1:MaxValue: 123452.3 double1:DistinctNum: 4.0 double1:MinValue: 12.3 double1:NullNum: 1.0 double1:TopK: {12.3=1.0, 67892.3=1.0, 123452.3=1.0} decimal1:MaxValue: 22.4 decimal1:DistinctNum: 4.0 decimal1:MinValue: 2.4 decimal1:NullNum: 1.0 decimal1:TopK: {2.4=1.0, 12.4=1.0, 22.4=1.0} decimal2:MaxValue: 52.5 decimal2:DistinctNum: 4.0 decimal2:MinValue: 2.57 decimal2:NullNum: 1.0 decimal2:TopK: {2.57=1.0, 42.5=1.0, 52.5=1.0} string1:MaxLength 6.0 string1:AvgLength: 3.0 string1:DistinctNum: 4.0 string1:NullNum: 1.0 string1:TopK: {str1=1.0, str12=1.0, str123=1.0} varchar1:MaxLength 6.0 varchar1:AvgLength: 3.0 varchar1:DistinctNum: 4.0 varchar1:NullNum: 1.0 varchar1:TopK: {str2=1.0, str200=1.0, str21=1.0} boolean1:DistinctNum: 3.0 boolean1:NullNum: 1.0 boolean1:TopK: {false=2.0, true=1.0} timestamp1:DistinctNum: 3.0 timestamp1:NullNum: 1.0 timestamp1:TopK: {2018-09-17 00:00:00.0=2.0, 2018-09-18 00:00:00.0=1.0} datetime1:DistinctNum: 3.0 datetime1:NullNum: 1.0 datetime1:TopK: {1537117199000=2.0, 1537030799000=1.0}
MaxComputeのオプティマイザのメタデータを収集する方法の詳細については、「MaxComputeのオプティマイザの情報を収集する」をご参照ください。