enso/test
GregoryTravis 8260a9587f
Column-level lexically-scoped CTE expressions (#10826)
This implements `DB_Column.with`, which uses `WITH ... AS` SQL clauses to remove duplicates in the generated SQL.

After a discussion with @radeusgd, we concluded that we will probably want a more complete CTE implementation, so this one is useful for now to deal with big queries (like `round`).

# Important Notes
Still to do in this PR:

- [x] Rename `with` to `let` (or something similar)
- [x] tests
- [x] documentation
- [x] remove `State` hack by moving query generation into a class and using a `Ref` field for scoping

Results on `round_float`:

| --- | SQL length in characters (unprettified) | SQL length in lines (prettified) |
| --- | --- | --- |
| Without CTEs | 13193 | 851 |
| With CTEs | 3644 | 187 |

Compare the SQL:

[without-ctes.sql.txt](https://github.com/user-attachments/files/16629356/without-ctes.sql.txt)
[with-ctes.sql.txt](https://github.com/user-attachments/files/16629357/with-ctes.sql.txt)

Update, with name shortening:

| --- | SQL length in characters (unprettified) | SQL length in lines (prettified) |
| --- | --- | --- |
| Without CTEs | 13193 | 853 |
| With CTEs | 2427 | 176 |

[without-cte.txt](https://github.com/user-attachments/files/16694328/without-cte.txt)
[with-cte.txt](https://github.com/user-attachments/files/16694327/with-cte.txt)
2024-08-28 18:23:51 +00:00
..
AWS_Tests Column-level lexically-scoped CTE expressions (#10826) 2024-08-28 18:23:51 +00:00
Base_Internal_Tests Mixed Decimal/Float operations throw error or attach warning (#10725) 2024-08-14 16:45:28 +00:00
Base_Tests Column-level lexically-scoped CTE expressions (#10826) 2024-08-28 18:23:51 +00:00
Benchmarks Adding vectorized implementations to some Column operations (#10795) 2024-08-13 08:53:39 +00:00
Examples_Tests Rename Map to Dictionary and Set to Hashset. (#10474) 2024-07-09 09:12:23 +00:00
Exploratory_Benchmarks Final step removing the Problem_Behavior publishing. (#10461) 2024-07-05 18:41:36 +00:00
Geo_Tests Snowflake Dialect pt. 6 - Union, Distinct and other improvements (#10576) 2024-07-19 16:04:00 +00:00
Google_Api_Test Enso tests can be run with filter from cmdline (#9065) 2024-02-22 12:31:44 +00:00
Helpers Implement private methods (#10060) 2024-05-31 08:00:20 +00:00
Image_Tests Writing to Data Links (#9750) 2024-04-25 17:55:49 +00:00
micro-distribution IO.print without new line (#10858) 2024-08-24 07:00:16 +02:00
Microsoft_Tests Make sqlserver temp tables work (#10781) 2024-08-09 13:06:16 +03:00
Snowflake_Tests Column-level lexically-scoped CTE expressions (#10826) 2024-08-28 18:23:51 +00:00
Table_Tests Column-level lexically-scoped CTE expressions (#10826) 2024-08-28 18:23:51 +00:00
Tableau_Tests Adding support for creating Atoms in expressions (#10820) 2024-08-15 15:52:30 +00:00
Visualization_Tests Initial enso changes to ScatterPlot (#10871) 2024-08-28 13:39:55 +00:00