【发布时间】:2015-09-16 06:08:43
【问题描述】:
我遇到了 Oozie 的 Hive 行动的问题。当我查询分区的 Hive 表时,Oozie 的 hive 操作失败并出现以下错误。:
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
但是,当我使用 OOzie 的配置单元操作查询未分区的不同配置单元表时,工作流运行成功。
自从我们将 hive 从 0.11.x 升级到 0.13.1 后,我开始收到此错误
【问题讨论】:
-
您的配置单元分区查询在没有 oozie 的情况下是否有效?
-
是的,查询在 hive cli 上运行良好。还有旧版本的 Oozie 和 Hive 0.11.x 我也尝试设置 hive.exec.optimize.dynamic.partition.sort=false
-
"我们将 hive 从 0.11.x 升级到 0.13.1" => 您是否升级了 Oozie ShareLib for Hive 操作?
-
非常感谢 Samson Scharfrichter。升级 Oozie ShareLib 真的很有帮助。