xiedeyantu commented on code in PR #4752: URL: https://github.com/apache/calcite/pull/4752#discussion_r2701251334
########## core/src/test/resources/sql/new-decorr.iq: ########## @@ -42,4 +42,45 @@ SELECT * FROM t0 WHERE t0a < !ok +# [CALCITE-7356] The MARK JOIN generated by TopDownGeneralDecorrelator needs to be adapted to RelFieldTrimmer +!use blank +CREATE TABLE emps ( + empid INTEGER NOT NULL, + deptno INTEGER NOT NULL, + name VARCHAR(10) NOT NULL, + salary DECIMAL(10, 2) NOT NULL, + commission INTEGER); +(0 rows modified) + +!update + +INSERT INTO emps (empid, deptno, name, salary, commission) VALUES +(100, 10, 'Bill', 10000.00, 1000), +(200, 20, 'Eric', 8000.00, 500), +(150, 10, 'Sebastian', 7000.00, NULL), +(110, 10, 'Theodore', 11500.00, 250), +(170, 30, 'Theodore', 11500.00, 250), +(140, 10, 'Sebastian', 7000.00, NULL); +(6 rows modified) + +!update + +SELECT *, EXISTS(select * from ( + SELECT e2.deptno FROM emps e2 where e1.commission = e2.commission) as table3 + where table3.deptno <> e1.deptno) +from emps e1 order by empid; ++-------+--------+-----------+----------+------------+--------+ +| EMPID | DEPTNO | NAME | SALARY | COMMISSION | EXPR$5 | ++-------+--------+-----------+----------+------------+--------+ +| 100 | 10 | Bill | 10000.00 | 1000 | false | +| 110 | 10 | Theodore | 11500.00 | 250 | true | +| 140 | 10 | Sebastian | 7000.00 | | false | +| 150 | 10 | Sebastian | 7000.00 | | false | +| 170 | 30 | Theodore | 11500.00 | 250 | true | +| 200 | 20 | Eric | 8000.00 | 500 | false | ++-------+--------+-----------+----------+------------+--------+ +(6 rows) Review Comment: The result is checked using pgsql. link is [here](https://onecompiler.com/postgresql/44asaqbe5). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
