wecharyu commented on code in PR #6179:
URL: https://github.com/apache/hive/pull/6179#discussion_r2569286196


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java:
##########
@@ -1451,24 +1448,69 @@ public static FilterType fromClass(Object value){
 
     @Override
     public void visit(LeafNode node) throws MetaException {
-      int partColCount = partitionKeys.size();
-      int partColIndex = LeafNode.getPartColIndexForFilter(node.keyName, 
partitionKeys, filterBuffer);
+      String filter = visitCondition(node.getCondition(), true);
       if (filterBuffer.hasError()) {
         return;
       }
 
+      filterBuffer.append("(" + filter + ")");
+    }
+
+    @Override
+    public void visit(MultiAndLeafNode node) throws MetaException {

Review Comment:
   > The RexUtil#flattenAnd does exactly what is described in this PR.
   
   @zabetak you are right, the `OR` will be add in `addAnd` function, so it 
does the same thing like this PR: 
https://github.com/apache/calcite/blob/96b05ee12f936ed057265072ff6a2de8ea0a249e/core/src/main/java/org/apache/calcite/rex/RexUtil.java#L1322
   
   If we change to use Calcite's rule, we need replace the `TreeNode` with 
`RexCall`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to