【问题标题】:Talend (7.0.1) - Cannot modify mapred.job.name at runtimeTalend (7.0.1) - 无法在运行时修改 mapred.job.name
【发布时间】:2018-05-04 13:52:10
【问题描述】:

我在 Talend OS for Big Data (Print of the job where I am getting this error) 中运行简单的 tHiveCreateTable 作业时遇到了一些问题。 Hive 连接正常,并且在集群中激活 Ranger 之前,该作业一直有效。

在ranger之后,我开始得到以下日志:

   [statistics] connecting to socket on port 3345
   [statistics] connected
   Error while processing statement: Cannot modify mapred.job.name at runtime. It is not in list of params that are allowed to be modified at runtime
   [statistics] disconnected

使用 Tez 或 MapReduce 进行作业会发生此错误,在自动生成的代码的以下行中引发异常:

    // For MapReduce Mode
    stmt_tHiveCreateTable_1.execute("set mapred.job.name=" + queryIdentifier);

您知道任何解决方案或解决方法吗?

提前致谢

【问题讨论】:

  • 我找到了一种方法来解决这个问题,寻找类似的错误。解决方法是在 hive-site.xml 中配置属性 hive.security.authorization.sqlstd.confwhitelist,顾名思义,它可以创建配置白名单,以便在运行时对其进行修改。
  • 嗨@ssobreiro,如果可以在 tHiveConnection 的高级设置中设置这些属性,请告诉我?我试过了,但它似乎不起作用
  • 嗨@user1023627。白名单属性必须在 hive-site.xml 中配置。 Hive 服务将在运行时允许或拒绝 mapred 更新。而且,据我所知,在 tHiveConnection 的高级属性中配置 mapred 属性是没有用的,因为 Talend 会尝试以任何一种方式更新值(如果我错了,请有人纠正我 :))。
  • 谢谢@ssobreiro。请告诉我,我需要添加到 hive-site.xml 的属性名称和详细信息
  • 嗨@user1023627。您可以添加一个名为“hive.security.authorization.sqlstd.confwhitelist”的属性(如果它尚不存在)。例如,对于值使用,您需要列入白名单的属性的名称用“|”分隔(管道)。当我处理这个问题时,这对我有用。使用例如:hive.security.authorization.sqlstd.confwhitelist.appendmapred.job.name|tez\.queue\.name|my\.third\.property 无论如何...我相信应该有更好的解决方案:)

标签: hive talend


【解决方案1】:

可以通过 Talend7 作业在运行时禁用更改 mapreduce.job.name 和 hive.query.name。

编辑文件

{talend_install_dir}/plugins/org.talend.designer.components.localprovider_7.1.1.20181026_1147/components/templates/Hive/SetQueryName.javajet

并像这样注释掉第 6 行和第 11 行:

// stmt_<%=cid %>.execute("set mapred.job.name=" + queryIdentifier_<%=cid %>);
// stmt_<%=cid %>.execute("set hive.query.name=" + queryIdentifier_<%=cid %>);

它为我解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-07
    • 1970-01-01
    相关资源
    最近更新 更多