快捷搜索: 王者荣耀 脱发

hive 调用python脚步报错

Error: java.lang.RuntimeException: Hive Runtime Error while closing operators: [Error 20003]: An error occurred when trying to close the Operator running your custom script. at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.close(ExecReducer.java:287) at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:453) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:392) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158) Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: [Error 20003]: An error occurred when trying to close the Operator running your custom script. at org.apache.hadoop.hive.ql.exec.ScriptOperator.close(ScriptOperator.java:587) at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:655) at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:655) at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.close(ExecReducer.java:279)

... 7 more

在对 进行 select 查询的时候 我们可以编写 、 、c++等脚本来进行相应的数据处理,我们要用到hive 的 TRANSFORM 和 using

这里我们需要注意的是,一定要先 将map脚本添加到分布式缓存中,否则会报错

解决办法,添加脚本路径,如

hive>add file oss://LTA.py;

  1. hive>add file /demo.py;
经验分享 程序员 微信小程序 职场和发展