Julian Hyde created CALCITE-6281:
------------------------------------

             Summary: Add test infrastructure to ensure that Calcite is 
consistent with the SQL dialects it is trying to emulate
                 Key: CALCITE-6281
                 URL: https://issues.apache.org/jira/browse/CALCITE-6281
             Project: Calcite
          Issue Type: Improvement
            Reporter: Julian Hyde


Add test infrastructure to ensure that Calcite is consistent with the SQL 
dialects it is trying to emulate.

Calcite is able to emulate other SQL dialects. For example, it can pretend to 
be MySQL by setting "lib=mysql, lex=mysql, conformance=mysql_5". In that mode, 
the user would expect there to be a SUBSTR function, and  that {{SUBSTR('abc' 
FROM 0)}} would [return the empty string, the same as 
MySQL|https://github.com/apache/calcite/blob/022d878a73dec796bb72743804a6dded7c239bd3/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java#L9428].
 (On Postgres, the same expression returns 'abc'.)

How do we trust that MySQL does indeed have that behavior? How do we find out 
if, in a later release, the MySQL team decides to change the behavior. That is 
the goal of this case.

We propose to add tests that run expressions on both MySQL and 
Calcite-pretending-to-be-MySQL, and ensure that the result is the same on both. 
We use [testContainers|https://github.com/testcontainers/testcontainers-java] 
to instantiate, via Docker, and instance of MySQL.

See discussion [Ensuring that Calcite is consistent with other SQL 
systems|https://lists.apache.org/thread/mxy9p6cy8sssf1sq3gz7zkzm6hsysns5]. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to