hive - Hive Beeline 使用 ACID 事务管理器
问题描述
我正在尝试使用直线运行此命令。
create table <table_1> like <table_2>
但似乎我的 Hive 配置为在 ACID 模式下运行。所以这个查询失败了
错误:编译语句时出错:失败:SemanticException [错误 10265]:在具有非 ACID 事务管理器的 ACID 表上不允许使用此命令。失败的命令:创建表(状态=42000,代码=10265)
在不更改任何全局配置的情况下,使用 ACID 事务管理器运行直线查询的正确语法是什么?
我的直线命令是:
beeline -u <jdbc_con> -e "create table <table_1> like <table_2>";
我想我应该使用类似的东西
hive>set hive.support.concurrency = true;
hive>set hive.enforce.bucketing = true;
hive>set hive.exec.dynamic.partition.mode = nonstrict;
hive>set hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
hive>set hive.compactor.initiator.on = true;
hive>set hive.compactor.worker.threads = a positive number on at least one instance of the Thrift metastore service;
但是我应该如何将它包含在直线中?当我尝试
beeline -u $jdbc_con -e "set hive.support.concurrency = true; create table <table_1>_test like <table_2>";
似乎不可能以这种方式更改这些参数。
错误:处理语句时出错:无法在运行时修改 hive.support.concurrency。它不在允许在运行时修改的参数列表中(状态=42000,代码=1)
感谢您的任何帮助。
解决方案
您可以设置配置单元属性并从直线运行配置单元查询,如下所示:
beeline -u $jdbc_con \
--hiveconf "hive.support.concurrency=true" \
--hiveconf "hive.enforce.bucketing=true" \
-e "create table <table_1>_test like <table_2>"
希望这会有所帮助。
推荐阅读
- amazon-web-services - 使用 IoT Rule SQL 一次查询多个主题
- angular - 离子 4-cordova-plugin-chrome-apps-sockets-udp
- r - How do i find the actual outliers in the boxplot in R
- java - Java android Q create PDF java.lang.IllegalArgumentException: Unknown URL
- java - 我们应该在使用 Logback 记录计算数据时使用 isDebugEnabled() 吗?
- python - How to keep x and y-axis equal with a colorbar?
- php - 在 Doctrine 中创建实体时完全按 ID 引用外键
- javascript - How to pass a variable reference to a function in JavaScript?
- python-3.x - 在大熊猫数据框上计算滚动坡度
- android - 在实时 startAt 查询中返回零节点