【问题标题】:Update the jar of a hive UDF更新配置单元 UDF 的 jar
【发布时间】:2018-04-13 09:28:58
【问题描述】:

TL;DR:如何在 hive 中更新自定义 UDF 的 jar?

我编写了自己的(通用)udf,效果很好。我可以定义一个新函数并将其与命令一起使用:

CREATE FUNCTION myfunc AS 'io.company.hive.udf.myfunc' USING JAR 'hdfs:///myudfs/myfunc.jar';

现在我想更新我的 udf,因此我想在 hdfs 中放置一个更新版本的 jar,同名。之后,发生的事情是:

  • 第一次调用函数给出java.io.IOException: Previous writer likely failed to write hdfs://ip-10-0-10-xxx.eu-west-1.compute.internal:8020/tmp/hive/hive/_tez_session_dir/0de6055d-190d-41ee-9acb-c6b402969940/myfunc.jar Failing because I am unlikely to write too.
  • 第二个电话给org.apache.hadoop.hive.ql.metadata.HiveException: Default queue should always be returned.Hence we should not be here.

日志文件显示:

Localizing resource because it does not exist: file:/tmp/8f45f1b7-2850-4fdc-b07e-0b53b3ddf5de_resources/myfunc.jar to dest: hdfs://ip-10-0-10-129.eu-west-1.
compute.internal:8020/tmp/hive/hive/_tez_session_dir/994ad52c-4b38-4ee2-92e9-67076afbbf10/myfunc.jar
tez.DagUtils (DagUtils.java:localizeResource(961)) - Looks like another thread is writing the same file will wait.
tez.DagUtils (DagUtils.java:localizeResource(968)) - Number of wait attempts: 5. Wait interval: 5000
tez.DagUtils (DagUtils.java:localizeResource(984)) - Could not find the jar that was being uploaded

我已经尝试过的:

  • 将 jar 添加到 hive.reloadable.aux.jars.pathhive.aux.jar.path
  • list jar/delete jar/create function/reload 的不同组合无济于事。

我什至最终得到一个查询,显然开始正常,但随后就挂在那里,没有继续前进,日志中没有任何内容,没有创建 DAG。

INFO  : converting to local hdfs:///hive-udf-wp/hive-udf-wp.jar
INFO  : Added [/tmp/19e0c9fc-9c7c-4de5-a034-ced062f87f64_resources/hive-udf-wp.jar] to class path
INFO  : Added resources: [hdfs:///hive-udf-wp/hive-udf-wp.jar]

我认为要求 tex 不重用当前会话可以解决问题,因为这样会在没有旧版本 jar 的情况下创建新会话。这会是一个选择吗?

【问题讨论】:

    标签: hive hive-udf


    【解决方案1】:

    我知道处理此问题的唯一方法是重新启动 hive。
    (我还在寻找更新udf的好方法。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多