xiedeyantu commented on code in PR #5013:
URL: https://github.com/apache/calcite/pull/5013#discussion_r3392586171
##########
core/src/test/resources/sql/struct.iq:
##########
@@ -187,4 +187,45 @@ select row(d.*, row(d.*)) from dept d limit 1;
!ok
+# [CALCITE-7364] Support the syntax ROW(T.* EXCLUDE cols) for creating nested
ROW values
+select row(* exclude(empno)) from emp order by empno limit 1;
++----------------------------------------------------+
+| EXPR$0 |
++----------------------------------------------------+
+| {SMITH, CLERK, 7902, 1980-12-17, 800.00, null, 20} |
++----------------------------------------------------+
+(1 row)
+
+!ok
+
+select row(emp.* exclude(emp.empno)) from emp order by empno limit 1;
++----------------------------------------------------+
+| EXPR$0 |
++----------------------------------------------------+
+| {SMITH, CLERK, 7902, 1980-12-17, 800.00, null, 20} |
++----------------------------------------------------+
+(1 row)
+
+!ok
+
+select row(* exclude(empno, mgr)) from emp order by empno limit 1;
++----------------------------------------------+
+| EXPR$0 |
++----------------------------------------------+
+| {SMITH, CLERK, 1980-12-17, 800.00, null, 20} |
++----------------------------------------------+
+(1 row)
+
+!ok
+
+select row(emp.* exclude(emp.empno), dept.*) from emp join dept on emp.deptno
= dept.deptno order by emp.empno limit 1;
Review Comment:
It looks like this case could be added as well; it looks pretty good.
```
select row(emp.* exclude(emp.empno), dept.* exclude(dept.deptno)) from emp
join dept on emp.deptno = dept.deptno order by emp.empno limit 1;
+--------------------------------------------------------------------------+
| EXPR$0 |
+--------------------------------------------------------------------------+
| {SMITH, CLERK, 7902, 1980-12-17, 800.00, null, 20, 20, RESEARCH, DALLAS} |
+--------------------------------------------------------------------------+
(1 row)
!ok
```
##########
core/src/test/resources/sql/struct.iq:
##########
@@ -187,4 +187,45 @@ select row(d.*, row(d.*)) from dept d limit 1;
!ok
+# [CALCITE-7364] Support the syntax ROW(T.* EXCLUDE cols) for creating nested
ROW values
+select row(* exclude(empno)) from emp order by empno limit 1;
++----------------------------------------------------+
+| EXPR$0 |
++----------------------------------------------------+
+| {SMITH, CLERK, 7902, 1980-12-17, 800.00, null, 20} |
++----------------------------------------------------+
+(1 row)
+
+!ok
+
+select row(emp.* exclude(emp.empno)) from emp order by empno limit 1;
++----------------------------------------------------+
+| EXPR$0 |
++----------------------------------------------------+
+| {SMITH, CLERK, 7902, 1980-12-17, 800.00, null, 20} |
++----------------------------------------------------+
+(1 row)
+
+!ok
+
+select row(* exclude(empno, mgr)) from emp order by empno limit 1;
Review Comment:
Should the current error logs be modified?
```
with t(x, y) as (values(1, 2))
select row(* exclude(x, y)) from t;
SELECT * EXCLUDE/EXCEPT list cannot exclude all columns
!error
```
--
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]