DESCRIBE STAGE

描述为暂存区中的属性指定的值(文件格式、副本和位置),以及每个属性的默认值。

DESCRIBE 可以缩写为 DESC。

另请参阅:

DROP STAGEALTER STAGECREATE STAGESHOW STAGES

语法

DESC[RIBE] STAGE <name>
Copy

参数

name

指定要描述的暂存区的标识符。如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。

使用说明

  • 若要对此命令的输出进行后处理,可以使用 RESULT_SCAN 函数,该函数会将输出视为可查询的表。

输出

命令输出在以下列中提供暂存区属性和元数据。

描述

parent_property

每个暂存区属性所属的父属性。可能的值包括 STAGE_FILE_FORMAT、STAGE_COPY_OPTIONS、STAGE_LOCATION、STAGE_CREDENTIALS 和 DIRECTORY。

property

属性的名称。有关属性说明,请参阅 CREATE STAGE

property_type

属性类型。

property_value

分配给属性的值。

property_default

默认属性值。

备注

对于具有目录表的暂存区,输出包括名为 LAST_REFRESHED_ON 且类型为 TIMESTAMP 的属性。LAST_REFRESHED_ON 指示目录表的元数据上次手动或自动与暂存区上的关联文件同步的时间。

示例

描述一个名为 my_s3_stage 的内部暂存区:

DESC STAGE my_s3_stage;
+--------------------+--------------------------------+---------------+-------------------------------------------------------+------------------+
| parent_property    | property                       | property_type | property_value                                        | property_default |
|--------------------+--------------------------------+---------------+-------------------------------------------------------+------------------|
| STAGE_FILE_FORMAT  | TYPE                           | String        | CSV                                                   | CSV              |
| STAGE_FILE_FORMAT  | RECORD_DELIMITER               | String        | \n                                                    | \n               |
| STAGE_FILE_FORMAT  | FIELD_DELIMITER                | String        | ,                                                     | ,                |
| STAGE_FILE_FORMAT  | FILE_EXTENSION                 | String        |                                                       |                  |
| STAGE_FILE_FORMAT  | SKIP_HEADER                    | Integer       | 0                                                     | 0                |
| STAGE_FILE_FORMAT  | DATE_FORMAT                    | String        | AUTO                                                  | AUTO             |
| STAGE_FILE_FORMAT  | TIME_FORMAT                    | String        | AUTO                                                  | AUTO             |
| STAGE_FILE_FORMAT  | TIMESTAMP_FORMAT               | String        | AUTO                                                  | AUTO             |
| STAGE_FILE_FORMAT  | BINARY_FORMAT                  | String        | HEX                                                   | HEX              |
| STAGE_FILE_FORMAT  | ESCAPE                         | String        | NONE                                                  | NONE             |
| STAGE_FILE_FORMAT  | ESCAPE_UNENCLOSED_FIELD        | String        | \\                                                    | \\               |
| STAGE_FILE_FORMAT  | TRIM_SPACE                     | Boolean       | false                                                 | false            |
| STAGE_FILE_FORMAT  | FIELD_OPTIONALLY_ENCLOSED_BY   | String        | NONE                                                  | NONE             |
| STAGE_FILE_FORMAT  | NULL_IF                        | List          | [\\N]                                                 | [\\N]            |
| STAGE_FILE_FORMAT  | COMPRESSION                    | String        | AUTO                                                  | AUTO             |
| STAGE_FILE_FORMAT  | ERROR_ON_COLUMN_COUNT_MISMATCH | Boolean       | true                                                  | true             |
| STAGE_FILE_FORMAT  | VALIDATE_UTF8                  | Boolean       | true                                                  | true             |
| STAGE_FILE_FORMAT  | SKIP_BLANK_LINES               | Boolean       | false                                                 | false            |
| STAGE_FILE_FORMAT  | REPLACE_INVALID_CHARACTERS     | Boolean       | false                                                 | false            |
| STAGE_FILE_FORMAT  | EMPTY_FIELD_AS_NULL            | Boolean       | true                                                  | true             |
| STAGE_FILE_FORMAT  | SKIP_BYTE_ORDER_MARK           | Boolean       | true                                                  | true             |
| STAGE_FILE_FORMAT  | ENCODING                       | String        | UTF8                                                  | UTF8             |
| STAGE_COPY_OPTIONS | ON_ERROR                       | String        | ABORT_STATEMENT                                       | ABORT_STATEMENT  |
| STAGE_COPY_OPTIONS | SIZE_LIMIT                     | Long          |                                                       |                  |
| STAGE_COPY_OPTIONS | PURGE                          | Boolean       | false                                                 | false            |
| STAGE_COPY_OPTIONS | RETURN_FAILED_ONLY             | Boolean       | false                                                 | false            |
| STAGE_COPY_OPTIONS | ENFORCE_LENGTH                 | Boolean       | true                                                  | true             |
| STAGE_COPY_OPTIONS | TRUNCATECOLUMNS                | Boolean       | false                                                 | false            |
| STAGE_COPY_OPTIONS | FORCE                          | Boolean       | false                                                 | false            |
| STAGE_LOCATION     | URL                            | String        | ["s3://EXAMPLE-S3-PATH/my-csvfiles/"] |                  |
| STAGE_CREDENTIALS  | AWS_KEY_ID                     | String        |                                                       |                  |
| DIRECTORY          | LAST_REFRESHED_ON              | Timestamp     | 2023-05-03 12:50:28.000 -0700                         |                  |
| DIRECTORY          | ENABLE                         | Boolean       | true                                                  | false            |
| DIRECTORY          | AUTO_REFRESH                   | Boolean       | false                                                 | false            |
+--------------------+--------------------------------+---------------+-------------------------------------------------------+------------------+
Copy
语言: 中文