Unify semicolon and comment handling in nested native queries (#30677)
* Unify semicolon and comment handling in nested native queries * Use different comment and semicolon removal approach * Apply suggestions from code review Co-authored-by:metamben <103100869+metamben@users.noreply.github.com> * Update base and effective type verification for oracle * Avoid running test with snowflake and bigquery * Update `breakout-results` and test 1. In `breakout-results` case driver statement was redundant. Original code had field name and types hardcoded. During further examination, I've realized name and types are available thanks to the use of `qp.test/col`, so are just "unhardcoded" :) 2. `card-id-native-source-queries-test` is altered, so instead of hardcoding native sub-queries, roughly equivalent* mbql query is compiled and its native form is used. This way I can hopefully avoid problems with extraction of cloud databases' table names for testing purposes. * By roughly equivalent I mean instead of using * for selecting fields, mbql is compiled selecting fields explicitly. Also limit is added in some cases, but local testing showed no problems with that. --------- Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com>
Showing
- src/metabase/driver/sql/query_processor.clj 26 additions, 3 deletionssrc/metabase/driver/sql/query_processor.clj
- src/metabase/driver/sql/query_processor/deprecated.clj 1 addition, 3 deletionssrc/metabase/driver/sql/query_processor/deprecated.clj
- src/metabase/query_processor/middleware/fetch_source_query.clj 4 additions, 26 deletions...etabase/query_processor/middleware/fetch_source_query.clj
- test/metabase/driver/sql/parameters/substitute_test.clj 6 additions, 3 deletionstest/metabase/driver/sql/parameters/substitute_test.clj
- test/metabase/driver/sql/query_processor_test.clj 41 additions, 0 deletionstest/metabase/driver/sql/query_processor_test.clj
- test/metabase/query_processor/middleware/fetch_source_query_test.clj 0 additions, 10 deletions...se/query_processor/middleware/fetch_source_query_test.clj
- test/metabase/query_processor_test/nested_queries_test.clj 40 additions, 32 deletionstest/metabase/query_processor_test/nested_queries_test.clj
Loading
Please register or sign in to comment