【问题标题】:SemanticException [Error 10265] while running simple hive select query on a transactional hive table在事务性配置单元表上运行简单配置单元选择查询时出现 SemanticException [错误 10265]
【发布时间】:2017-03-08 19:18:27
【问题描述】:

我在 hive 中创建了表:

CREATE TABLE test_table (COL1 string, COL2 string, COL3 string, COL4 string) CLUSTERED BY(COL2) INTO 4 BUCKETS STORED AS ORC tblproperties("transactional"="true");

现在尝试在 hive 提示中使用 putty 进行查询:

select * from test_db.test_table;

此操作失败并显示以下消息:

失败:SemanticException [错误 10265]:不允许使用此命令 在具有非 ACID 事务的 ACID 表 test_db.test_table 上 经理。失败的命令:null

请帮我解决这个错误。

【问题讨论】:

    标签: database hive hiveql


    【解决方案1】:

    Hive 事务管理器必须设置为 org.apache.hadoop.hive.ql.lockmgr.DbTxnManager 才能使用 ACID 表。

    SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
    

    另外,设置这些属性来开启事务支持

    客户端

    SET hive.support.concurrency=true;
    SET hive.enforce.bucketing=true;
    SET hive.exec.dynamic.partition.mode=nonstrict;
    

    服务器端(元存储)

    SET hive.compactor.initiator.on=true;
    SET hive.compactor.worker.threads=1;
    

    注意:将这些属性添加到hive-site.xml 以永久设置它们。

    【讨论】:

      猜你喜欢
      • 2018-02-27
      • 2015-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-08
      相关资源
      最近更新 更多