【问题标题】:How to write local orc file using Presto如何使用 Presto 编写本地 orc 文件
【发布时间】:2020-01-24 12:16:25
【问题描述】:

如何使用 localfile 连接器和 presto 的 orc 文件格式写入结果 CTAS(crate table as) 文件

示例查询:

 CREATE TABLE localfile.default.lineitem_orc_parted with (
  format = 'ORC',
  partitioned_by = ARRAY['commityear'],
  bucketed_by = ARRAY['linenumber'],
  bucket_count = 7
) AS SELECT *,year(commitdate) as commityear from tcph.sf100.lineitem limit 100000000;

--> 目录'localfile'不支持表属性'format'

是否有可能有/没有分区,分桶?

【问题讨论】:

    标签: presto orc trino


    【解决方案1】:

    Presto localfile connector 目前仅支持从http-request.log 读取。它不允许读取 ORC 文件,也不允许创建任何表。没有真正适合从 Presto 中转储 ORC 文件的内置连接器。

    作为一种解决方法,我建议使用Presto Hive connector 并将 (CTAS) 写入表。然后你只需从表的位置复制文件。

    如果这不能满足您的需求,我建议您创建一个问题:https://github.com/prestosql/presto/issues 并加入 Presto Slack 上的对话。

    【讨论】:

    • 是的,它可以与 hive 连接器一起使用,但我的目的是比较远程 hive+orc 和 localstorage+orc。据我了解,现在不可能。 Localfile 连接器不支持创建表、ctas、orc 文件等。仅支持 http-request.log 表读取。
    猜你喜欢
    • 2019-06-26
    • 2021-07-27
    • 2018-05-20
    • 1970-01-01
    • 1970-01-01
    • 2016-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多