Presto是否支持插入覆盖到Hive表格?

huangapple go评论77阅读模式
英文:

Does presto support insert overwrite into hive table?

问题

我正在尝试将数据插入到一个分区表中。我正在使用PrestoSqlOperator(airflow DAG)运行presto/trino SQL查询。

我能够使用以下命令将数据插入到表中:

Insert into table ......

但是,如果我尝试使用以下命令:

Insert overwrite table .....

它会抛出错误。

请帮助我找到正确的语句。

我还尝试过删除分区,但没有取得太多成功。

英文:

I am trying to insert data into a partioned table. I am using PrestoSqlOperator ( airflow DAG) to run a presto/trino SQL query.

I am able to insert data into table using command

Insert into table......

But if I am trying to use below command

Insert overwrite table .....

It's throwing error.

Please help me with the correct statement.

I have also tried to drop the partition, but did not get much success.

答案1

得分: 1

INSERT OVERWRITE功能在Trino版本419中添加。

先前的实现是:

SET SESSION hive.insert_existing_partitions_behavior='OVERWRITE';
INSERT INTO hive.test2.insert_test SELECT * FROM tpch.sf1.customer;

更多详情请参阅https://github.com/trinodb/trino/issues/11602以及https://github.com/trinodb/trino/issues?page=2&q=+insert+overwrite和https://github.com/trinodb/trino/issues?page=2&q=+insert+overwrite。

英文:

INSERT OVERWRITE feature was added in Trino v 419

INSERT OVERWRITE hive.test2.insert_test SELECT * FROM tpch.sf1.customer;

Previous implementation is:

SET SESSION hive.insert_existing_partitions_behavior='OVERWRITE';
INSERT INTO hive.test2.insert_test SELECT * FROM tpch.sf1.customer;

See more details https://github.com/trinodb/trino/issues/11602
https://github.com/trinodb/trino/issues?page=2&q=+insert+overwrite
and https://github.com/trinodb/trino/issues?page=2&q=+insert+overwrite

huangapple
  • 本文由 发表于 2023年5月18日 02:25:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76275160.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定