SHOW TBLPROPERTIES

適用対象:「はい」のチェック マーク Databricks SQL 「はい」のチェック マーク Databricks Runtime

プロパティ キーに省略可能な値を指定して、テーブル プロパティの値を返します。 キーが指定されていない場合は、すべてのプロパティとオプションが返されます。 テーブル オプションの先頭には option が付いています。

構文

SHOW TBLPROPERTIES table_name
   [ ( [unquoted_property_key | property_key_as_string_literal] ) ]

unquoted_property_key
  key_part1 [. ...]

パラメーター

  • table_name

    テーブルを識別します。 この名前には、テンポラル仕様を含めることはできません。

  • unquoted_property_key

    引用符で囲まれていない形式のプロパティ キー。 キーは、ドットで区切られた複数の要素で構成できます。

  • property_key_as_string_literal

    文字列リテラルとしてのプロパティ キーの値。

注意

このステートメントによって返されるプロパティ値では、Spark と Hive の内部にある一部のプロパティが除外されます。 除外されるプロパティは次のとおりです。

  • プレフィックス spark.sql で始まるすべてのプロパティ
  • EXTERNALcomment などのプロパティ キー
  • 統計情報を格納するために Hive によって内部的に生成されたすべてのプロパティ。 これらのプロパティには、numFilesnumPartitionsnumRows などがあります。

-- create a table `customer` in schema `salessc`
> USE salessc;
> CREATE TABLE customer(cust_code INT, name VARCHAR(100), cust_addr STRING)
    TBLPROPERTIES ('created.by.user' = 'John', 'created.date' = '01-01-2001');

-- show all the user specified properties for table `customer`
> SHOW TBLPROPERTIES customer;
                   key      value
 --------------------- ----------
       created.by.user       John
          created.date 01-01-2001
 transient_lastDdlTime 1567554931

-- show all the user specified properties for a qualified table `customer`
-- in schema `salessc`
> SHOW TBLPROPERTIES salessc.customer;
                   key      value
 --------------------- ----------
       created.by.user       John
          created.date 01-01-2001
 transient_lastDdlTime 1567554931

-- show value for unquoted property key `created.by.user`
> SHOW TBLPROPERTIES customer (created.by.user);
 value
 -----
  John

-- show value for property `created.date`` specified as string literal
> SHOW TBLPROPERTIES customer ('created.date');
      value
 ----------
 01-01-2001