sreeharshar84 commented on code in PR #4192:
URL: https://github.com/apache/calcite/pull/4192#discussion_r1955405434
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -8225,6 +8225,27 @@ private void checkLiteral2(String expression, String
expected) {
.withOracle(11).ok(expectedVersionLow);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6819">[CALCITE-6819]
+ * MSSQL doesn't support TRUE/FALSE keywords in its Join predicate</a>. */
+ @Test void testJoinBoolLiteralMSSQL() {
+ final String queryTrue = "SELECT \"hire_date\", \"department_description\"
FROM \"employee\" "
+ + "LEFT JOIN \"department\" ON TRUE";
+ final String mssqlExpected1 = "SELECT [employee].[hire_date],"
+ + " [department].[department_description]\nFROM
[foodmart].[employee]\nLEFT JOIN"
+ + " [foodmart].[department] ON (1 = 1)";
+ sql(queryTrue)
+ .dialect(MssqlSqlDialect.DEFAULT).ok(mssqlExpected1);
+
+ final String queryFalse = "SELECT \"hire_date\",
\"department_description\" FROM \"employee\" "
Review Comment:
I discussed this issue in my comment in the
Jira(https://issues.apache.org/jira/browse/CALCITE-6819?focusedCommentId=17926427&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17926427).
IMHO, fixing the issue for SELECT TRUE is a bit more complicated
(CALCITE-6829). And the problem doesn't exist for HAVING AND WHERE.
This is why I have restricted the issue to the Join related fix.
--
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]