A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-tblproperties below:

Table properties and table options

Table properties and table options

Applies to: Databricks SQL Databricks Runtime

Defines user defined tags for tables and views.

TBLPROPERTIES​

Sets one or more table properties in a new table or view.

You can use table properties to tag tables with information not tracked by SQL.

Syntax​
TBLPROPERTIES ( { property_key [ = ] property_val } [, ...] )

property_key
{ identifier [. ...] | string_literal }
Parameters​ Examples​

SQL


> CREATE TABLE T(c1 INT) TBLPROPERTIES('this.is.my.key' = 12, this.is.my.key2 = true);
> SHOW TBLPROPERTIES T;
key value

...
this.is.my.key 12
this.is.my.key2 true
...
SET TBLPROPERTIES​

Sets one or more table properties in an existing table or view.

Syntax​
SET TBLPROPERTIES ( { property_key [ = ] property_val } [, ...] )

property_key
{ identifier [. ...] | string_literal }
Parameters​ Examples​

SQL


> ALTER TABLE T SET TBLPROPERTIES(this.is.my.key = 14, 'this.is.my.key2' = false);
> SHOW TBLPROPERTIES T;
key value

...
this.is.my.key 14
this.is.my.key2 false
...
UNSET TBLPROPERTIES​

Removes one or more table properties from a table or view.

Syntax​
UNSET TBLPROPERTIES [ IF EXISTS ] ( property_key [, ...] )

property_key
{ identifier [. ...] | string_literal }
Parameters​ Examples​

SQL


> ALTER TABLE T UNSET TBLPROPERTIES(this.is.my.key, 'this.is.my.key2');
> SHOW TBLPROPERTIES T;
key value

... keys other that key and key2 ...
OPTIONS​

Sets one or more table options in a new table.

The purpose of table options is to pass storage properties to the underlying storage, such as SERDE properties to Hive.

Specifying table options for Delta Lake tables will also echo these options as table properties.

Syntax​
OPTIONS ( { property_key [ = ] property_val } [, ...] )

property_key
{ identifier [. ...] | string_literal }
Parameters​ Examples​

SQL



> CREATE TABLE T(c1 INT) OPTIONS(this.is.my.key = 'blue' || 'green');
> SHOW TBLPROPERTIES T;
key value

...
option.this.is.my.key bluegreen
...
Reserved table property keys​

Databricks reserves some property keys for its own use and raises an error if you attempt to use them:

You should not use property keys starting with the option identifier. This prefix identifier will be filtered out in SHOW TBLPROPERTIES. The option prefix is also used to display table options.

Common TBLPROPERTIES and OPTIONS keys​

The following settings are commonly used with Delta Lake:

Related articles​

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4