databrickslabs / remorph

Cross-compiler and Data Reconciler into Databricks Lakehouse
Other
37 stars 23 forks source link

TSQL: Adds tests and support for SELECT OPTION(...) generation #755

Closed jimidle closed 2 months ago

jimidle commented 2 months ago

Here, we add code generation support for TSQL SELECT ... OPTION(...) clause.

Any query hints supplied with a SELECT statement are now generated as comments in the output code, in case they may be useful in assessing query performance after remorph transpilation. As in the following sample:

SELECT * FROM t
            OPTION (
            MAXRECURSION 10,
            SOMETHING ON,
            SOMETHINGELSE OFF,
            SOMEOTHER AUTO,
            SOMEstrOpt = 'STRINGOPTION')

Transpiles to:

/*
   The following statement was originally given the following OPTIONS:

    Expression options:

     MAXRECURSION = 10

    String options:

     SOMESTROPT = 'STRINGOPTION'

    Boolean options:

     SOMETHING ON
     SOMETHINGELSE OFF

    Auto options:

     SOMEOTHER AUTO

 */
SELECT * FROM t
github-actions[bot] commented 2 months ago

Coverage tests results

401 tests  ±0   109 :white_check_mark: ±0   4s :stopwatch: ±0s   2 suites ±0     0 :zzz: ±0    2 files   ±0   292 :x: ±0 

For more details on these failures, see this check.

Results for commit 46007e2a. ± Comparison against base commit 1663d473.