当我尝试运行此配置单元查询时:
create table my_db.test_table
as (select * from my_db.my_table
where partition_date >= '2019-06-01')
STORED as PARQUET;
我看到错误:
SQL Error [1]: Query failed (#1): line 5:1: mismatched
input 'STORED' expecting {<EOF>, 'EXCEPT', 'INTERSECT',
'LIMIT', 'ORDER', 'UNION', 'WITH'}
这与my_db.my_table
为RCBINARY
格式的事实有关吗?还是不了解stored as
是什么意思?
如果死于RCBINARY
,我该如何从RCBINARY
格式转换为PARQUET
?
答案 0 :(得分:1)
我意识到这是一个presto数据库,而不是Hive问题。
这对我有用:
create table my_db.test_table
WITH (format = 'PARQUET')
as (select * from my_db.my_table
where partition_date >= '2019-06-01');
答案 1 :(得分:0)
您必须在选择语句之前将stored as
指定为-
create table my_db.test_table
STORED as PARQUET
as (select * from my_db.my_table
where partition_date >= '2019-06-01')
请参阅CTAS格式here