为单个查询/连接设置配置单元优先级

2024-05-07 00:35:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我们的团队使用python执行配置单元查询。但是,繁重的查询总是会阻塞其他较轻的查询,并且必须等待一个多小时

是否可以为单个连接设置优先级或vcpu资源

在配置中设置“yarn.nodemanager.resource.cpu-vcores”或“mapred.job.priority”是解决方案吗

configuration = {
    "mapred.job.priority": 'LOW',
    "yarn.nodemanager.resource.cpu-vcores": 2
}
# configuration={}

con = hive.connect(ip, port=10000, auth=auth, kerberos_service_name='hive', database=db_name, configuration=configuration)

如果是,如何修复It is not in list of params that are allowed to be modified at runtime错误

谢谢


Tags: nameauthjobcpu团队configurationresource单元
1条回答
网友
1楼 · 发布于 2024-05-07 00:35:32

由于您直接连接到配置单元,因此设置中的hive.security.authorization.sqlstd.confwhitelist.append值似乎不正确或太严格,不允许在运行时设置变量

这里描述了解决方案here。示例hiveserver2.xml值与正则表达式中的值:

<property>
    <name>hive.security.authorization.sqlstd.confwhitelist.append</name>
    <value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>
<property>
    <name>hive.security.authorization.sqlstd.confwhitelist</name>
    <value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>

相关问题 更多 >