NobiGo commented on code in PR #4151: URL: https://github.com/apache/calcite/pull/4151#discussion_r1920944243
########## core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java: ########## @@ -7960,6 +7960,32 @@ private void checkLiteral2(String expression, String expected) { .withBigQuery().ok(expectedBiqquery); } + /** Test case for + * <a href="https://issues.apache.org/jira/browse/CALCITE-6756">[CALCITE-6756] + * Preserving CAST of STRING operand in binary comparison for PostgreSQL</a>. */ + @Test void testImplicitTypeCoercionPostgreSQL() { + final String query = "select \"employee_id\" " + + "from \"foodmart\".\"employee\" " + + "where 10 = cast(\"full_name\" as int) and " + + " \"first_name\" > cast(10 as varchar) and " + + "\"birth_date\" = cast('1914-02-02' as date) or " + + "\"hire_date\" = cast('1996-01-01 '||'00:00:00' as timestamp) or " + + "\"hire_date\" = '1996-01-01 00:00:00' or " + + "cast(\"full_name\" as timestamp) = \"hire_date\" or " + + "cast('10' as varchar) = 1"; Review Comment: It will become `null = 1` works well in PG. Because NULL will be an integer type and there will be no cast operation. -- 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: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org