【问题标题】:Can't create a delta lake table in hive无法在配置单元中创建增量湖表
【发布时间】:2023-01-13 18:17:06
【问题描述】:

我正在尝试在配置单元 3 中创建一个 delta 湖表。 我将 delta-hive-assembly_2.11-0.3.0.jar 移动到 hive aux 目录并设置到 hive cli

SET hive.input.format=io.delta.hive.HiveInputFormat;
SET hive.tez.input.format=io.delta.hive.HiveInputFormat;

但是当我尝试创建表时,它会抛出以下错误:

[2b8497c1-b4d3-492e-80a5-ec4db4119018 HiveServer2-Handler-Pool: Thread-133]: Exception occured while getting the URI from storage handler: Expected authority at index 22: deltastoragehandler://: Unsupported ex
java.net.URISyntaxException: Expected authority at index 22: deltastoragehandler://: Unsupported ex
    at org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler.getURIForAuth(DefaultStorageHandler.java:76) ~[hive-exec-3.1.3000.7.1.7.0-551.jar:3.1.3000.7.1.7.0-551]
    at org.apache.hadoop.hive.ql.security.authorization.command.CommandAuthorizerV2.addHivePrivObject(CommandAuthorizerV2.java:210) [hive-exec-3.1.3000.7.1.7.0-551.jar:3.1.3000.7.1.7.0-551]

创建语句:

CREATE EXTERNAL TABLE default.test_delta
( id INT, activ INT)
STORED BY 'io.delta.hive.DeltaStorageHandler'
LOCATION '/dev/delta/tessttt';

有谁知道为什么会发生此错误?

【问题讨论】:

    标签: hive delta-lake


    【解决方案1】:
    Hello, you need to add in the properties of the table the following: TBLPROPERTIES('DO_NOT_UPDATE_STATS'='true');
    
    Example
    CREATE EXTERNAL TABLE default.test_delta
    ( id INT, activ INT)
    STORED BY 'io.delta.hive.DeltaStorageHandler'
    LOCATION '/dev/delta/tessttt'
    TBLPROPERTIES('DO_NOT_UPDATE_STATS'='true';
    
    The solution also works for iceberg format.
    Inspired by: https://github.com/delta-io/connectors/issues/279
    

    【讨论】:

    • 请阅读How to Answeredit 你的答案,以解释为什么这段代码实际上会解决手头的问题。永远记住,您不仅在解决问题,而且还在教育 OP 和这篇文章的任何未来读者。
    • 谢谢你,阿德里安!
    猜你喜欢
    • 1970-01-01
    • 2015-07-19
    • 2019-02-07
    • 2016-05-20
    • 1970-01-01
    • 2015-04-16
    • 1970-01-01
    • 2023-03-04
    • 2021-12-22
    相关资源
    最近更新 更多