Indhumathi27 commented on code in PR #5614:
URL: https://github.com/apache/hive/pull/5614#discussion_r1948494423
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/PartFilterVisitor.java:
##########
@@ -262,4 +262,163 @@ public String
visitQuotedIdentifier(PartitionFilterParser.QuotedIdentifierContex
return StringUtils.replace(ctx.getText().substring(1,
ctx.getText().length() -1 ), "``", "`");
}
+ @Override
+ public TreeNode
visitConditionIsBoolean(PartitionFilterParser.ConditionIsBooleanContext ctx) {
+ TreeNode exprNode = (TreeNode) visit(ctx.expression());
+ boolean isNegated = ctx.NOT() != null; // Check for negation (NOT)
+
+ // Retrieve the boolean literal (TRUE/FALSE) and handle negation
+ String booleanLiteral = ctx.booleanLiteral().getText();
+ switch (booleanLiteral.toUpperCase()) {
+ case "TRUE":
+ // For TRUE: return expression directly if not negated, otherwise
negate it
+ return isNegated ? negateTreeNode(exprNode) : exprNode;
+ case "FALSE":
+ // For FALSE: return negated expression if not negated, otherwise
return as is
+ return isNegated ? exprNode : negateTreeNode(exprNode);
+ default:
Review Comment:
booleanLiteral is just a string variable name which is used in G4 file
--
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]