mihaibudiu commented on code in PR #5094:
URL: https://github.com/apache/calcite/pull/5094#discussion_r3566920115
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -3905,6 +3905,20 @@ private SqlDialect nonOrdinalDialect() {
.withBigQuery().ok(expectedBigQuery);
}
+ /** Tests that a backslash in a character literal is escaped for BigQuery,
+ * which uses backslash as the escape character. Without doubling the
+ * backslash the generated literal is terminated early. */
+ @Test void testCharLiteralWithBackslashForBigQuery() {
+ final String query = "select 'a\\b' from \"product\"";
+ final String expectedPostgresql = "SELECT 'a\\b'\n"
+ + "FROM \"foodmart\".\"product\"";
+ final String expectedBigQuery = "SELECT 'a\\\\b'\n"
+ + "FROM foodmart.product";
+ sql(query)
Review Comment:
I assume you have validated the resulting query using BigQuery?
--
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]