Struct CreateTable
pub struct CreateTable {Show 53 fields
pub or_replace: bool,
pub temporary: bool,
pub external: bool,
pub dynamic: bool,
pub global: Option<bool>,
pub if_not_exists: bool,
pub transient: bool,
pub volatile: bool,
pub iceberg: bool,
pub name: ObjectName,
pub columns: Vec<ColumnDef>,
pub constraints: Vec<TableConstraint>,
pub hive_distribution: HiveDistributionStyle,
pub hive_formats: Option<HiveFormat>,
pub table_options: CreateTableOptions,
pub file_format: Option<FileFormat>,
pub location: Option<String>,
pub query: Option<Box<Query>>,
pub without_rowid: bool,
pub like: Option<CreateTableLikeKind>,
pub clone: Option<ObjectName>,
pub version: Option<TableVersion>,
pub comment: Option<CommentDef>,
pub on_commit: Option<OnCommit>,
pub on_cluster: Option<Ident>,
pub primary_key: Option<Box<Expr>>,
pub order_by: Option<OneOrManyWithParens<Expr>>,
pub partition_by: Option<Box<Expr>>,
pub cluster_by: Option<WrappedCollection<Vec<Expr>>>,
pub clustered_by: Option<ClusteredBy>,
pub inherits: Option<Vec<ObjectName>>,
pub partition_of: Option<ObjectName>,
pub for_values: Option<ForValues>,
pub strict: bool,
pub copy_grants: bool,
pub enable_schema_evolution: Option<bool>,
pub change_tracking: Option<bool>,
pub data_retention_time_in_days: Option<u64>,
pub max_data_extension_time_in_days: Option<u64>,
pub default_ddl_collation: Option<String>,
pub with_aggregation_policy: Option<ObjectName>,
pub with_row_access_policy: Option<RowAccessPolicy>,
pub with_tags: Option<Vec<Tag>>,
pub external_volume: Option<String>,
pub base_location: Option<String>,
pub catalog: Option<String>,
pub catalog_sync: Option<String>,
pub storage_serialization_policy: Option<StorageSerializationPolicy>,
pub target_lag: Option<String>,
pub warehouse: Option<Ident>,
pub refresh_mode: Option<RefreshModeKind>,
pub initialize: Option<InitializeKind>,
pub require_user: bool,
}Expand description
CREATE TABLE statement.
OR REPLACE clause
TEMP or TEMPORARY clause
EXTERNAL clause
DYNAMIC clause
GLOBAL clause
IF NOT EXISTS clause
TRANSIENT clause
VOLATILE clause
ICEBERG clause
Table name
§columns: Vec<ColumnDef>Column definitions
Table constraints
Hive-specific distribution style
Hive-specific formats like ROW FORMAT DELIMITED or ROW FORMAT SERDE 'serde_class' WITH SERDEPROPERTIES (...)
Table options
General comment for the table
Location of the table data
Query used to populate the table
If the table should be created without a rowid (SQLite)
LIKE clause
CLONE clause
Table version (for systems that support versioned tables)
For Hive dialect, the table comment is after the column definitions without =,
so the comment field is optional and different than the comment field in the general options list.
Hive
SQLite “STRICT” clause. if the “STRICT” table-option keyword is added to the end, after the closing “)”, then strict typing rules apply to that table.