NobiGo commented on code in PR #3863:
URL: https://github.com/apache/calcite/pull/3863#discussion_r1687712138
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -7700,6 +7700,27 @@ private void checkLiteral2(String expression, String
expected) {
.withOracle(11).throws_("Lower Oracle version(<12) doesn't support
offset/fetch syntax!");
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6482">[CALCITE-6482]
+ * Oracle dialect convert bool literal when version < 23</a>.*/
Review Comment:
The Doc comment should stay the same as the JIRA summary. And we try not to
use abbreviations as much as possible.
##########
core/src/main/java/org/apache/calcite/sql/SqlDialect.java:
##########
@@ -466,6 +466,13 @@ public void unparseCall(SqlWriter writer, SqlCall call,
int leftPrec,
}
}
+ public void unparseBoolLiteral(SqlWriter writer,
+ SqlLiteral literal, int leftPrec, int rightPrec) {
+ Object value = literal.getValue();
+ writer.keyword(
+ !(value instanceof Boolean) ? "UNKNOWN" : (Boolean) value ? "TRUE" :
"FALSE");
Review Comment:
Why do we use `value instanceof Boolean`, not the `value == null`?CASE
condition has done the same thing, so I think `value == null` is clearer to me.
--
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]