Oozie - 分区 table 的 Hive 操作失败

Oozie - Hive action fails for partition table

我遇到了 Oozie 的 Hive 操作问题。当我查询分区的 Hive table 时,Oozie 的配置单元操作失败并出现以下错误。:

 
Caused by: org.apache.thrift.protocol.TProtocolException: Required field 'partitions' is unset! Struct:PartitionsByExprResult(partitions:null, hasUnknownPartitions:false)
  at org.apache.hadoop.hive.metastore.api.PartitionsByExprResult.validate(PartitionsByExprResult.java:389)
  at org.apache.hadoop.hive.metastore.api.PartitionsByExprResult$PartitionsByExprResultStandardScheme.read(PartitionsByExprResult.java:468)
  at org.apache.hadoop.hive.metastore.api.PartitionsByExprResult$PartitionsByExprResultStandardScheme.read(PartitionsByExprResult.java:423)
  at org.apache.hadoop.hive.metastore.api.PartitionsByExprResult.read(PartitionsByExprResult.java:359)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_partitions_by_expr_result$get_partitions_by_expr_resultStandardScheme.read(ThriftHiveMetastore.java:61455)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_partitions_by_expr_result$get_partitions_by_expr_resultStandardScheme.read(ThriftHiveMetastore.java:61440)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_partitions_by_expr_result.read(ThriftHiveMetastore.java:61371)
  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_get_partitions_by_expr(ThriftHiveMetastore.java:1814)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_partitions_by_expr(ThriftHiveMetastore.java:1801)
  at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.listPartitionsByExpr(HiveMetaStoreClient.java:828)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:89)
  at com.sun.proxy.$Proxy21.listPartitionsByExpr(Unknown Source)
  at org.apache.hadoop.hive.ql.metadata.Hive.getPartitionsByExpr(Hive.java:1938)
  at org.apache.hadoop.hive.ql.optimizer.ppr.PartitionPruner.getPartitionsFromServer(PartitionPruner.java:310)
  ... 47 more
</pre>
但是,当我查询未使用 OOzie 的配置单元操作进行分区的不同配置单元 table 时,工作流 运行 成功。 

自从我们将配置单元从 0.11.x 升级到 0.13.1

后,我就开始收到此错误

感谢@Samson Scharfrichter 我能够调试这个问题。 决议就在这个页面上 Upgrading the Shared Libraries on HDFS

检查hadoop fs -ls /user/oozie/share/lib/lib* dir.