tanclary commented on code in PR #3604:
URL: https://github.com/apache/calcite/pull/3604#discussion_r1438926061
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -6696,6 +6696,20 @@ private void checkLiteral2(String expression, String
expected) {
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withSnowflake().ok(expectedSnowflake);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6182">[CALCITE-6182]
+ * Add LENGTH/LEN functions (enabled in Snowflake library)</a>. */
+ @Test void testSnowflakeLength() {
+ final String query = "select CHAR_LENGTH(\"brand_name\")\n"
+ + "from \"product\"";
+ final String expectedBigQuery = "SELECT CHAR_LENGTH(brand_name)\n"
+ + "FROM foodmart.product";
+ final String expectedSnowflake = "SELECT LENGTH(\"brand_name\")\n"
+ + "FROM \"foodmart\".\"product\"";
+
sql(query).withLibrary(SqlLibrary.BIG_QUERY).withBigQuery().ok(expectedBigQuery);
+
sql(query).withLibrary(SqlLibrary.BIG_QUERY).withSnowflake().ok(expectedSnowflake);
Review Comment:
Added a comment and combined lines
--
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]