zabetak commented on code in PR #6179:
URL: https://github.com/apache/hive/pull/6179#discussion_r2567863628
##########
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. I don't
understand the argument that it doesn't handle `OR`. How does `OR` come into
the picture? I don't see any mention of OR in the description of this PR/JIRA.
As part of the CBO phase we already use `flattenAnd` method so in most cases
the predicates should be of the form `AND(p1,p2,p3,...,pn)` and not
`AND(AND(AND(p1,p2),...,pn)`. However, these expressions are send as
string/bytes from HS2 to HMS and the latter parses them again so not sure how
relevant are the optimizations that happen in the HS2 side.
In addition, there may be direct calls to HMS APIs (outside of HS2) and in
that case I suppose the expressions can be of any form.
--
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]