使用Presto插入静态配置单元分区

问题描述 投票:0回答:1

假设我要INSERT INTO一个静态配置单元分区,我可以用Presto来做到这一点吗?

PARTITION关键字仅适用于配置单元。

INSERT INTO TABLE Employee PARTITION (department='HR') 

原因:com.facebook.presto.sql.parser.ParsingException:行1:44:输入的“ PARTITION”不匹配。期望:“(”,位于com.facebook.presto.sql.parser.ErrorHandler.syntaxError(ErrorHandler.java:109)

hive presto hive-partitions
1个回答
0
投票

Presto中,您不需要PARTITION(department ='HR')。

INSERT INTO TABLE Employee (name, department)
VALUES  ('John', 'HR');

INSERT INTO TABLE Employee (name, department)
select 
      name, 
      'HR' --partition column is the last one
from 
...
© www.soinside.com 2019 - 2024. All rights reserved.