为了账号安全,请及时绑定邮箱和手机立即绑定

导入错误 Python Hive UDF

导入错误 Python Hive UDF

江户川乱折腾 2021-08-02 05:32:12
我想将一些常量放在一个 Python 文件中,然后将其导入到另一个文件中。我创建了两个文件,一个带有常量,一个导入它,一切都在本地运行良好:常量.py:CONST = "hi guy"test_constants.py:from constants import CONSTimport sysfor line in sys.stdin:    print(CONST)本地测试:$ echo "dummy" | python test_constants.pyhi guy使用 Hive (beeline) 进行测试:hive> add file hdfs://path/.../test_constants.py;No rows affected (0.191 seconds)hive> add file hdfs://path/.../constants.py;No rows affected (0.049 seconds)hive> list files;resource/tmp/bb09f878-7e36-4aa2-8566-a30950072bcb_resources/test_constants.py/tmp/bb09f878-7e36-4aa2-8566-a30950072bcb_resources/constants.py2 rows selected (0.179 seconds)hive> with t as (select 1 as dummy)   select transform (dummy)   using 'python test_constants.py'   as dummy_out   from t;Error: org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1535407036047_170618_1_00, diagnostics=[Task failed, taskId=task_1535407036047_170618_1_00_000000, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_1535407036047_170618_1_00_000000_0:java.lang.RuntimeException: java.lang.RuntimeException: Hive Runtime Error while closing operators
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 287 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号