xuzifu666 commented on code in PR #4854:
URL: https://github.com/apache/calcite/pull/4854#discussion_r3004552293
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -3692,11 +3692,30 @@ private SqlDialect nonOrdinalDialect() {
sql(query1).withClickHouse().ok(expected1);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-7316">[CALCITE-7316]
+ * The POSITION function in SQLite is missing the FROM clause</a>. */
@Test void testPositionFunctionForSqlite() {
final String query = "select position('A' IN 'ABC') from \"product\"";
final String expected = "SELECT INSTR('ABC', 'A')\n"
+ "FROM \"foodmart\".\"product\"";
sql(query).withSQLite().ok(expected);
+
+ final String query1 = "select position('C' IN 'ABCABC' FROM 4) from
\"product\"";
+ final String expected1 =
Review Comment:
+1. Additionally, there is another issue: for the query `select * from
db.table where d=position(a IN b FROM c)`, if this expression is placed within
the `WHERE` clause, we still need to enclose it in parentheses.
--
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]