Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
827
|
Contents
CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] database_name
[COMMENT database_comment]
[LOCATION hdfs_path]
[WITH DBPROPERTIES] (property_name=property_value, ...)];
The use of SCHEMA and DATABASE are interchangeable - they mean the same thing.
Example
DROP (DATABASE|SCHEMA) [IF NOT EXISTS] database_name
[RESTRICT|CASCADE];
The use of SCHEMA and DATABASE are interchangeable - they mean the same thing.
Example
ALTER (DATABASE|SCHEMA) database_name SET DBPROPERTIES (property_name=property_value, ...);
No other metadata about a database can be changed.
Example
CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name
[(col_name data_type [COMMENT col_comment], ...)]
[COMMENT table_comment]
[PARTITIONED BY (col_name data_type [COMMENT col_comment], ...)]
[CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name [ASC|DESC], ...)] INTO num_buckets BUCKETS]
[SKEWED BY (col_name, col_name, ...) ON ([(col_value, col_value, ...), ...|col_value, col_value, ...])
[
[ROW FORMAT row_format] [STORED AS file_format]
| STORED BY 'storage.handler.class.name' [WITH SERDEPROPERTIES (...)]
]
[LOCATION hdfs_path]
[TBLPROPERTIES (property_name=property_value, ...)]
The use of SCHEMA and DATABASE are interchangeable - they mean the same thing.
Example
DROP TABLE [IF EXISTS] table_name
The DROP TABLE removes metadata and data for this table. The data is actually moved to the .Trash/Current directory if Trash is configured.
TRUNCATE TABLE table_name [PARTITION partition_spec]
partition_spec:
(partition_col = partition_col_value, partition_col = partition_col_value, ...)
ALTER TABLE table_name RENAME TO new_table_name
ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT col_comment], ...)
ALTER TABLE table_name SET TBLPROPERTIES table_properties
table_properties:
: (property_name = property_value, property_name = property_value, ... )
ALTER TABLE table_name [PARTITION partitionSpec] SET FILEFORMAT file_format
ALTER TABLE table_name CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name, ...)] INTO num_buckets BUCKETS
ALTER TABLE table_name [PARTITION partitionSpec] SET LOCATION "new location"
ALTER TABLE table_name TOUCH [PARTITION partitionSpec];
CREATE VIEW [IF NOT EXISTS] view_name [(column_name [COMMENT column_comment], ...) ]
[COMMENT view_comment]
[TBLPROPERTIES (property_name = property_value, ...)]
AS SELECT ...
DROP VIEW [IF EXISTS] view_name
ALTER VIEW view_name SET TBLPROPERTIES table_properties
table_properties: : (property_name = property_value, property_name = property_value, ...)
CREATE INDEX index_name ON TABLE base_table_name (col_name, ...)
AS index_type
[WITH DEFERRED REBUILD]
[IDXPROPERTIES (property_name=property_value, ...)]
[IN TABLE index_table_name]
[
[ ROW FORMAT ...] STORED AS ...
| STORED BY ...
]
[LOCATION hdfs_path]
[TBLPROPERTIES (...)]
[COMMENT "index comment"]
DROP INDEX [IF EXISTS] index_name ON table_name
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017