Nota
O acesso a esta página requer autorização. Podes tentar iniciar sessão ou mudar de diretório.
O acesso a esta página requer autorização. Podes tentar mudar de diretório.
Aplica-se a:
Databricks SQL
Databricks Runtime
Mostra informações para todas as tabelas que correspondem à expressão regular fornecida.
A saída inclui informações básicas da tabela e do sistema de arquivos, como Last Access, Created By, Type, Provider, Table Properties, Location, Serde Library, InputFormat, OutputFormat, Storage Properties, Partition Provider, Partition Columnse Schema.
Se uma especificação de partição estiver presente, ela produzirá as informações específicas do sistema de arquivos da partição dada, como Partition Parameters e Partition Statistics. Não é possível usar uma expressão regular de tabela com uma especificação de partição.
Nota
Para compatibilidade com o Apache Spark, este comando renderiza os tipos de coluna da tabela usando a notação Apache Spark. A descrição do mapeamento para SQL está em Mapeamentos de Linguagem. Outras maneiras de obter informações sobre as colunas da tabela são DESCRIBE TABLEe, no Unity Catalog, INFORMATION_SCHEMA.COLUMNS.
Sintaxe
SHOW TABLE EXTENDED [ { IN | FROM } schema_name ] LIKE regex_pattern
[ PARTITION clause ]
Parâmetros
-
Especifica o nome do esquema. Se não for fornecido, usa o esquema atual.
regex_pattern
O padrão de expressão regular usado para filtrar tabelas indesejadas.
- Exceto por
*e|carácter, o padrão funciona como uma expressão regular. -
*sozinho corresponde a 0 ou mais caracteres e|é usado para separar várias expressões regulares diferentes, qualquer uma das quais pode corresponder. - Os espaços em branco iniciais e finais são removidos no padrão de entrada antes do processamento. A correspondência de padrão é insensível a maiúsculas e minúsculas.
- Exceto por
-
Opcionalmente, especificando partições. Não é possível usar um padrão regex de tabela com uma cláusula
PARTITION.
Exemplos
-- 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