적용 대상:
Databricks SQL
Databricks Runtime
지정된 정규식과 일치하는 모든 테이블에 대한 정보를 표시합니다.
출력에는 기본 테이블 정보와 파일 시스템 정보, 예를 들어 Last Access, Created By, Type, Provider, Table Properties, Location, Serde Library, InputFormat, OutputFormat, Storage Properties, Partition Provider, Partition Columns및 Schema등이 포함됩니다.
파티션 사양이 있는 경우 지정된 파티션의 파일 시스템 관련 정보(예: Partition Parameters 및 Partition Statistics.)를 출력합니다. 파티션 사양에는 테이블 정규식을 사용할 수 없습니다.
참고
Apache Spark와의 호환성을 위해 이 명령은 Apache Spark 표기법을 사용하여 테이블 열 형식을 렌더링합니다. SQL에 대한 매핑은 언어 매핑에 설명되어 있습니다. 테이블 열 정보를 검색하는 다른 방법은 DESCRIBE TABLE및 Unity 카탈로그의 INFORMATION_SCHEMA입니다.COLUMNS.
구문
SHOW TABLE EXTENDED [ { IN | FROM } schema_name ] LIKE regex_pattern
[ PARTITION clause ]
매개 변수
-
스키마 이름을 지정합니다. 제공되지 않으면 현재 스키마를 사용합니다.
regex_pattern
원치 않는 테이블을 필터링하는 데 사용되는 정규식 패턴입니다.
-
*및|문자를 제외하고 패턴은 정규식처럼 작동합니다. -
*는 단독으로 0개 이상의 문자와 일치하고,|는 하나만 일치하면 되는 여러 정규식을 구분하는 데 사용합니다. - 선행 및 후행 공백은 처리 전에 입력 패턴에서 잘립니다. 패턴 일치는 대/소문자를 구분하지 않습니다.
-
-
필요에 따라 파티션을 지정합니다.
PARTITION절에는 테이블 정규식 패턴을 사용할 수 없습니다.
예제
-- Assumes `employee` table partitioned by column `grade`
> CREATE TABLE employee(name STRING, grade INT) PARTITIONED BY (grade);
> INSERT INTO employee PARTITION (grade = 1) VALUES ('sam');
> INSERT INTO employee PARTITION (grade = 2) VALUES ('suj');
-- Show the details of the table
> SHOW TABLE EXTENDED LIKE 'employee';
database tableName isTemporary information
-------- --------- ----------- --------------------------------------------------------------
default employee false Database: default
Table: employee
Owner: root
Created Time: Fri Aug 30 15:10:21 IST 2019
Last Access: Thu Jan 01 05:30:00 IST 1970
Created By: Spark 3.0.0
Type: MANAGED
Provider: hive
Table Properties: [transient_lastDdlTime=1567158021]
Location: file:/opt/spark1/spark/spark-warehouse/employee
Serde Library: org.apache.hadoop.hive.serde2.lazy
.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io
.HiveIgnoreKeyTextOutputFormat
Storage Properties: [serialization.format=1]
Partition Provider: Catalog
Partition Columns: [`grade`]
Schema: root
-- name: string (nullable = true)
-- grade: integer (nullable = true)
-- show multiple table details with pattern matching
> SHOW TABLE EXTENDED LIKE 'employe*';
database tableName isTemporary information
-------- --------- ----------- --------------------------------------------------------------
default employee false Database: default
Table: employee
Owner: root
Created Time: Fri Aug 30 15:10:21 IST 2019
Last Access: Thu Jan 01 05:30:00 IST 1970
Created By: Spark 3.0.0
Type: MANAGED
Provider: hive
Table Properties: [transient_lastDdlTime=1567158021]
Location: file:/opt/spark1/spark/spark-warehouse/employee
Serde Library: org.apache.hadoop.hive.serde2.lazy
.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io
.HiveIgnoreKeyTextOutputFormat
Storage Properties: [serialization.format=1]
Partition Provider: Catalog
Partition Columns: [`grade`]
Schema: root
-- name: string (nullable = true)
-- grade: integer (nullable = true)
default employee1 false Database: default
Table: employee1
Owner: root
Created Time: Fri Aug 30 15:22:33 IST 2019
Last Access: Thu Jan 01 05:30:00 IST 1970
Created By: Spark 3.0.0
Type: MANAGED
Provider: hive
Table Properties: [transient_lastDdlTime=1567158753]
Location: file:/opt/spark1/spark/spark-warehouse/employee1
Serde Library: org.apache.hadoop.hive.serde2.lazy
.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io
.HiveIgnoreKeyTextOutputFormat
Storage Properties: [serialization.format=1]
Partition Provider: Catalog
Schema: root
-- name: string (nullable = true)
-- show partition file system details
> SHOW TABLE EXTENDED IN default LIKE 'employee' PARTITION (grade = 1);
database tableName isTemporary information
-------- --------- ----------- --------------------------------------------------------------
default employee false Partition Values: [grade=1]
Location: file:/opt/spark1/spark/spark-warehouse/employee
/grade=1
Serde Library: org.apache.hadoop.hive.serde2.lazy
.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io
.HiveIgnoreKeyTextOutputFormat
Storage Properties: [serialization.format=1]
Partition Parameters: {rawDataSize=-1, numFiles=1,
transient_lastDdlTime=1567158221, totalSize=4,
COLUMN_STATS_ACCURATE=false, numRows=-1}
Created Time: Fri Aug 30 15:13:41 IST 2019
Last Access: Thu Jan 01 05:30:00 IST 1970
Partition Statistics: 4 bytes
-- show partition file system details with regex fail
> SHOW TABLE EXTENDED IN default LIKE 'empl*' PARTITION (grade = 1);
Error: TABLE_OR_VIEW_NOT_FOUND