[ 
https://issues.apache.org/jira/browse/HIVE-11791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14790893#comment-14790893
 ] 

Gopal V commented on HIVE-11791:
--------------------------------

[~yalovyyi]: I have added the find bugs changes, but the compactExpr is still 
broken. Can you test with the following fix?

{code}
--- ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java
+++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java
@@ -331,6 +331,9 @@ static private ExprNodeDesc compactExpr(ExprNodeDesc expr) {
         if (allFalse) {
           return new ExprNodeConstantDesc(Boolean.FALSE);
         }
+        if (newChildren.size() == 1) {
+          return newChildren.get(0);
+        }
         // Nothing to compact, update expr with compacted children.
         ((ExprNodeGenericFuncDesc) expr).setChildren(newChildren);
       }
{code}

> Add unit test for HIVE-10122
> ----------------------------
>
>                 Key: HIVE-11791
>                 URL: https://issues.apache.org/jira/browse/HIVE-11791
>             Project: Hive
>          Issue Type: Test
>          Components: Metastore
>    Affects Versions: 1.1.0
>            Reporter: Illya Yalovyy
>            Assignee: Illya Yalovyy
>            Priority: Minor
>         Attachments: HIVE-11791.patch
>
>
> Unit tests for PartitionPruner.compactExpr()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to