[ https://issues.apache.org/jira/browse/HIVE-14298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388319#comment-15388319 ]
Chaoyu Tang edited comment on HIVE-14298 at 7/21/16 8:04 PM: ------------------------------------------------------------- When HMS could not parse or push down a partition filter such as those having clause like, PartFilterExprUtil.makeExpressionTree returns null for the exprTree, therefore generateSqlFilterForPushdown should be false, which in term need generateSqlFilter to return null for the null exprTree. It is quite easy to reproduce the NPE issue with following steps: set the HMS configurations: hive.metastore.try.direct.sql to true hive.metastore.limit.partition.request to a certain positive integer (-1 means disabled which is default). Run query like select * from sample_pt where code in ('53-5022', '53-5023') and dummy like '%1'; you will get "FAILED: SemanticException java.lang.NullPointerException" was (Author: ctang.ma): When HMS could not parse or push down a partition filter such as those having clause like, PartFilterExprUtil.makeExpressionTree returns null for the exprTree, therefore generateSqlFilterForPushdown should return false. It is quite easy to reproduce the NPE issue with following steps: set the HMS configurations: hive.metastore.try.direct.sql to true hive.metastore.limit.partition.request to a certain positive integer (-1 means disabled which is default). Run query like select * from sample_pt where code in ('53-5022', '53-5023') and dummy like '%1'; you will get "FAILED: SemanticException java.lang.NullPointerException" > NPE could be thrown in HMS when an ExpressionTree could not be made from a > filter > --------------------------------------------------------------------------------- > > Key: HIVE-14298 > URL: https://issues.apache.org/jira/browse/HIVE-14298 > Project: Hive > Issue Type: Bug > Components: Metastore > Reporter: Chaoyu Tang > Assignee: Chaoyu Tang > Attachments: HIVE-14298.patch > > > In many cases where an ExpressionTree could not be made from a filter (e.g. > parser fails to parse a filter etc.) and its value is null. But this null is > passed around and used by a couple of HMS methods which can cause > NullPointerException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)