----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/27737/ -----------------------------------------------------------
Review request for hive. Repository: hive-git Description ------- Querying a partition in PostgreSQL fails when using JDO (with hive.metastore.try.direct.sql=false). It is because the JDO pushdown filter generated for a query having inequality/between partition predicate uses DN indexOf function which is not working properly with postgresql. Hive (see generateJDOFilterOverPartitions in org.apache.hadoop.hive.metastore.parser.ExpressTree) uses some DN string functions (substring, indexOf) to get the value for a partitionKey. Actually there is a straightforward way (as implemented in this patch) to get it which in addition avoids the DN indexOf issue with postgresql. Diffs ----- metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java b8d1afc57642d9b07cb6b3b48c4ac9bcf6c76704 ql/src/test/queries/clientpositive/partition_multilevels.q PRE-CREATION ql/src/test/results/clientpositive/partition_multilevels.q.out PRE-CREATION Diff: https://reviews.apache.org/r/27737/diff/ Testing ------- The test cases provided in this patch have been tested against various DB including Derby, Mysql and PostgreSQL etc. Thanks, Chaoyu Tang