Defining Databricks Tables
The following properties are applicable to a Databricks Table object.
Tab |
Property |
Description |
Additional Information |
---|---|---|---|
Physical Name | Specifies the physical name of the table | ||
Database | Specifies the database to which the table belongs | ||
If Not Exists | Specifies that if the table already exists, no exception is thrown, and no action happens | ||
Use Replace Syntax | Specifies whether the REPLACE syntax is used | Selecting this option replaces the syntax with the new DDL that is generated during Forward Engineering. | |
Physical Only | Specifies whether the table appears in a physical model only | ||
Generate | Specifies whether a DDL statement is generated for the table during forward engineering | ||
General | Physical Name | Specifies the physical name of the table | |
Location |
Specifies the directory path where the table data is stored Specifies the path of an external table when a delta table is cloned |
Entering a location makes the table an external table.
|
|
Table Properties | Specifies a list of key-value pairs used to tag the table definition |
For example, CREATE TABLE `default`.`test` (`c` INT) USING text TBLPROPERTIES ( 'transient_lastDdlTime' = '1586269021'); This creates a table with the following table properties: 'transient_lastDdlTime' = '1586269021'. |
|
Using | Specifies the file format for the table | For example, TEXT. | |
Options | Specifies the table options to optimize table behavior | You can enter key-value pairs to define options for the table. | |
Version as | Specifies the version of a Delta table | This option is part of temporal specification and references a Delta table using its version. | |
Timestamp As | Specifies a timestamp of a Delta table | This option is part of temporal specification and references a Delta table at the specified point in time. | |
Like Table | Specifies the table from which the table definition and metadata is copied | ||
Clone Table | Specifies the source delta table that is cloned | ||
Clone Type | Specifies the clone type |
Shallow: Indicates that Databricks copies the source table definition and does not copy data Deep: Indicates that Databricks makes a complete, independent copy of the source table |
|
Storage | Fields Terminated By | Specifies a character that defines column separator | For example, comma ' , '. |
Fields Escaped By | Specifies an escape mechanism | ||
Collection Items Terminated By | Specifies a character that defines collection item separator | For example, underscore ' _ '. | |
Map Keys Terminated By | Specifies a character to define a map key separator | For example, colon ' : '. | |
Lines Terminated By | Specifies a row separator character | For example, new line ' \n '. | |
Null Defined As | Specifies a value for NULL | For example, ' foonull'. | |
Serde Handler Class | Specifies a fully qualified class of a custom SerDe |
Default classes are available when Stored As is set to ORC, AVRO, or PARQUET. This option is blank if native SerDe is used. |
|
Stored As | Specifies the file format for the table | ||
Input Format | Specifies the input format for the table | Default formats are available when Stored As is set to TEXTFILE, SEQUENCE FILE, ORC, PARQUET, AVRO, or RCFILE. | |
Output Format | Specifies the output format of the table | ||
Stored By | Specifies a non-native table format using a storage handler | For example, org.apache.hadoop.hive.hbase.HBaseStorageHandler | |
Serde Properties | Specifies a list of key-value pairs used to define SerDe properties | ||
Bucketing and Partition | Bucket Columns | Specifies the columns based on which partitions on the table are converted into fixed buckets | These columns are specified using the CLUSTERED BY clause in the Create Table statement. This clause is not supported by Delta Lake. |
Bucket Sorted Columns | Specifies the order in which data is stored in buckets | This order is specified using the SORTED BY clause in the Create Table statement. This clause is not supported by Delta Lake. | |
Bucket Option | Specifies the number of buckets into which each partition is divided | ||
Name | Specifies the name of the partition | ||
Partition Specification | Specifies the partition specification | ||
Location | Specifies the location of the partition |
Copyright © 2024 Quest Software, Inc. |