NobiGo commented on code in PR #4192:
URL: https://github.com/apache/calcite/pull/4192#discussion_r1956045212


##########
core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java:
##########
@@ -196,4 +197,12 @@ public static SqlSpecialOperator 
specialOperatorByName(String opName) {
       }
     };
   }
+
+  public static void writeAlwaysCondition(SqlWriter writer, boolean value) {

Review Comment:
   This method requires some annotations to clarify that some databases require 
converting True to '1=1' and false to '1=0'.



##########
core/src/main/java/org/apache/calcite/sql/dialect/OracleSqlDialect.java:
##########
@@ -139,11 +141,7 @@ public OracleSqlDialect(Context context) {
       return;
     }
     // low version oracle not support bool literal
-    final SqlWriter.Frame frame = writer.startList("(", ")");
-    writer.literal("1");
-    writer.sep(SqlStdOperatorTable.EQUALS.getName());
-    writer.literal(value ? "1" : "0");
-    writer.endList(frame);
+    writeAlwaysCondition(writer, value);

Review Comment:
   unparseBoolLiteralToCondition?



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