[ASTERIXDB-3000] Incorrect result in SQL-compat mode
authorDmitry Lychagin <dmitry.lychagin@couchbase.com>
Thu, 16 Dec 2021 01:29:17 +0000 (17:29 -0800)
committerDmitry Lychagin <dmitry.lychagin@couchbase.com>
Thu, 16 Dec 2021 22:45:37 +0000 (22:45 +0000)
commit311d6f7dd3a4e1273dbd615cc7b19f23232f6d84
tree6b83dce7752107af49bbd3acc281893df703b293
parent3030acb653b41a52c97a842043e36739f1677554
[ASTERIXDB-3000] Incorrect result in SQL-compat mode

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix incorrect subquery coercion rewriting in SQL-compat
  mode if the subquery has an ORDER BY clause
- Add tests

Change-Id: Ia852f20864c2098221011dee4f2c738a52dc8368
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14543
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
14 files changed:
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_01_scalar/subquery_coercion_01_scalar.10.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_03_cmp/subquery_coercion_03_cmp.15.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.11.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.12.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.13.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.14.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_01_scalar/subquery_coercion_01_scalar.10.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_03_cmp/subquery_coercion_03_cmp.15.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.11.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.12.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.13.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/sql-compat/subquery_coercion_05_in/subquery_coercion_05_in.14.adm [new file with mode: 0644]
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlCompatRewriteVisitor.java