strongduanmu commented on code in PR #25424:
URL: https://github.com/apache/shardingsphere/pull/25424#discussion_r1185655965


##########
sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java:
##########
@@ -356,7 +356,7 @@ private BinaryOperationExpression 
createPatternMatchingOperationSegment(final AE
     
     private BinaryOperationExpression createBinaryOperationSegment(final 
AExprContext ctx, final String operator) {
         if ("IS".equalsIgnoreCase(operator)) {
-            ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
+            String ifOperator = operator;

Review Comment:
   What does ifOperator mean?
   



##########
sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java:
##########
@@ -441,7 +446,9 @@ public final ASTNode visitBooleanPrimary(final 
BooleanPrimaryContext ctx) {
             ExpressionSegment right = new 
LiteralExpressionSegment(ctx.IS().getSymbol().getStopIndex() + 2, 
ctx.stop.getStopIndex(), rightText);
             String text = ctx.start.getInputStream().getText(new 
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
             ExpressionSegment left = (ExpressionSegment) 
visit(ctx.booleanPrimary());
-            String operator = "IS";
+            if (null != ctx.NULL()) {
+                right = null;

Review Comment:
   Can you refer 
https://github.com/polardb/polardbx-sql/blob/cdd976850bdfc3264dff279198b6b06eb8641fbe/polardbx-optimizer/src/main/java/com/alibaba/polardbx/optimizer/parse/visitor/FastSqlToCalciteNodeVisitor.java#L5346-L5350
 to extract `is` and `is not` as an operator, and keep the right to 
LiteralExpressionSegment?



##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionEngine.java:
##########
@@ -77,6 +77,8 @@ public final class EncryptConditionEngine {
         SUPPORTED_COMPARE_OPERATOR.add("<=");
         SUPPORTED_COMPARE_OPERATOR.add("IS");

Review Comment:
   Please remove useless IS operator.



-- 
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]

Reply via email to