为Teradat
创建表格语法 Create table <DBname>.<Tablename> as select * from <DBname>.<Tablename> with data.
类似的方式我们如何在SPARK SQL中创建表。
答案 0 :(得分:1)
它在Spark SQL中几乎相同。
示例:强>
CREATE TABLE tablename
STORED AS PARQUET LOCATION 'some/location/incase/of/external/table'
AS
SELECT *
FROM source_table
WHERE 1=1
正则表达式:(高级别)
CREATE [TEMPORARY] [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name
[(col_name data_type [COMMENT col_comment], ...)]
[COMMENT table_comment]
[
[ROW FORMAT row_format]
[STORED AS file_format]
]
[LOCATION path_to_save]
[AS select_statement]
BTW,Spark支持更多Hive语法和功能。你可以参考CTAS doc here