[ 
https://issues.apache.org/jira/browse/CALCITE-6281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17820939#comment-17820939
 ] 

Julian Hyde commented on CALCITE-6281:
--------------------------------------

Work in progress, based on Stamatis' [PR 
3704|https://github.com/apache/calcite/pull/3704]: 
[6281-emulation-tests|https://github.com/julianhyde/calcite/tree/6281-emulation-tests].

> 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
>            Assignee: Julian Hyde
>            Priority: Major
>
> 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