-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Transpile
EXCEPT
and REPLACE
clauses
- rewrite `EXCEPT` into DuckDB's `EXCLUDE` - suppress `REPLACE` since DuckDB replace the Value of an existing column instead assigning an Alias Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
- Loading branch information
1 parent
9a2692f
commit 469af1c
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/test/resources/ai/starlake/transpiler/any/except_clause.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- provided | ||
SELECT TOP 10 * EXCEPT( salesid, listid, sellerid) REPLACE( eventid AS "EVENT_ID") | ||
FROM sales; | ||
|
||
-- expected | ||
SELECT * /*WARNING: DuckDB replaces Column's content instead Column's label, so unsupported.*/ EXCLUDE( salesid, listid, sellerid) | ||
FROM sales | ||
LIMIT 10; | ||
|
||
-- result | ||
"buyerid","eventid","dateid","qtysold","pricepaid","commission","saletime" | ||
"21191","7872","1875","4","728.00","109.20","2008-02-18 02:36:48.0" | ||
"11498","4337","1983","2","76.00","11.40","2008-06-06 05:00:16.0" | ||
"17433","8647","1983","2","350.00","52.50","2008-06-06 08:26:17.0" | ||
"19715","8647","1986","1","175.00","26.25","2008-06-09 08:38:52.0" | ||
"14115","8240","2069","2","154.00","23.10","2008-08-31 09:17:02.0" | ||
"24888","3375","2023","2","394.00","59.10","2008-07-16 11:59:24.0" | ||
"7952","3375","2003","4","788.00","118.20","2008-06-26 12:56:06.0" | ||
"19715","3375","2017","1","197.00","29.55","2008-07-10 02:12:36.0" | ||
"29891","3375","2029","3","591.00","88.65","2008-07-22 02:23:17.0" | ||
"10542","4769","2044","1","65.00","9.75","2008-08-06 02:51:55.0" |