DESCRIBE FILE FORMAT¶
描述属性类型(例如,字符串 或 整型)、属性的定义值,以及文件格式对象定义中每个属性的默认值。有关每种文件类型的可用属性的更多信息,请参阅 CREATE FILE FORMAT 中的“格式类型选项”。
DESCRIBE 可以缩写为 DESC。
语法¶
DESC[RIBE] FILE FORMAT <name>
参数¶
name指定要描述的文件格式的标识符。如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
使用说明¶
To post-process the output of this command, you can use the pipe operator (
->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is
type, then specify"type"for the identifier.
示例¶
描述名为 my_csv_format 的文件格式对象:
DESC FILE FORMAT my_csv_format;输出:
+--------------------------------+---------------+----------------+------------------+ | property | property_type | property_value | property_default | +--------------------------------+---------------+----------------+------------------+ | TYPE | String | csv | CSV | | RECORD_DELIMITER | String | \n | \n | | FIELD_DELIMITER | String | , | , | | FILE_EXTENSION | String | | | | SKIP_HEADER | Integer | 0 | 0 | | PARSE_HEADER | Boolean | FALSE | FALSE | | DATE_FORMAT | String | AUTO | AUTO | | TIME_FORMAT | String | AUTO | AUTO | | TIMESTAMP_FORMAT | String | AUTO | AUTO | | BINARY_FORMAT | String | HEX | HEX | | ESCAPE | String | NONE | NONE | | ESCAPE_UNENCLOSED_FIELD | String | \\ | \\ | | TRIM_SPACE | Boolean | FALSE | FALSE | | FIELD_OPTIONALLY_ENCLOSED_BY | String | NONE | NONE | | NULL_IF | List | [\\N] | [\\N] | | COMPRESSION | String | AUTO | AUTO | | ERROR_ON_COLUMN_COUNT_MISMATCH | Boolean | TRUE | TRUE | | VALIDATE_UTF8 | Boolean | TRUE | TRUE | | SKIP_BLANK_LINES | Boolean | FALSE | FALSE | | REPLACE_INVALID_CHARACTERS | Boolean | FALSE | FALSE | | EMPTY_FIELD_AS_NULL | Boolean | TRUE | TRUE | | SKIP_BYTE_ORDER_MARK | Boolean | TRUE | TRUE | | ENCODING | String | UTF8 | UTF8 | +--------------------------------+---------------+----------------+------------------+
描述名为 my_json_format 的文件格式对象:
DESC FILE FORMAT `my_json_format`;输出:
+----------------------------+---------------+----------------+------------------+ | property | property_type | property_value | property_default | +----------------------------+---------------+----------------+------------------+ | TYPE | String | JSON | CSV | | FILE_EXTENSION | String | | | | DATE_FORMAT | String | AUTO | AUTO | | TIME_FORMAT | String | AUTO | AUTO | | TIMESTAMP_FORMAT | String | AUTO | AUTO | | BINARY_FORMAT | String | HEX | HEX | | TRIM_SPACE | Boolean | FALSE | FALSE | | NULL_IF | List | [] | [\\N] | | COMPRESSION | String | AUTO | AUTO | | ENABLE_OCTAL | Boolean | FALSE | FALSE | | ALLOW_DUPLICATE | Boolean | FALSE | FALSE | | STRIP_OUTER_ARRAY | Boolean | FALSE | FALSE | | STRIP_NULL_VALUES | Boolean | FALSE | FALSE | | IGNORE_UTF8_ERRORS | Boolean | FALSE | FALSE | | REPLACE_INVALID_CHARACTERS | Boolean | FALSE | FALSE | | SKIP_BYTE_ORDER_MARK | Boolean | TRUE | TRUE | +----------------------------+---------------+----------------+------------------+
描述名为 my_parquet_format 的文件格式对象:
DESC FILE FORMAT `my_parquet_format`;输出:
+----------------+---------------+----------------+------------------+ | property | property_type | property_value | property_default | +----------------+---------------+----------------+------------------+ | TYPE | String | PARQUET | CSV | | TRIM_SPACE | Boolean | FALSE | FALSE | | NULL_IF | List | [] | [\\N] | | COMPRESSION | String | SNAPPY | AUTO | | BINARY_AS_TEXT | Boolean | TRUE | TRUE | +----------------+---------------+----------------+------------------+