xiedeyantu commented on code in PR #4665:
URL: https://github.com/apache/calcite/pull/4665#discussion_r2627280695
##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -3925,27 +3940,38 @@ SqlNode Expression3(ExprContext exprContext) :
LOOKAHEAD(3)
<ROW> {
s = span();
+ pushRowValueStar();
Review Comment:
I configured a Spark environment and tested the following SQL statements,
all of which were executable.
```
spark-sql (mydb)> SELECT STRUCT(*) AS row_data FROM dept;
{"deptno":10,"dname":"ACCOUNTING","loc":"NEW YORK"}
{"deptno":40,"dname":"OPERATIONS","loc":"BOSTON"}
{"deptno":20,"dname":"RESEARCH","loc":"DALLAS"}
{"deptno":30,"dname":"SALES","loc":"CHICAGO"}
Time taken: 0.207 seconds, Fetched 4 row(s)
spark-sql (mydb)> SELECT STRUCT(*, STRUCT(*)) AS row_data FROM dept;
{"deptno":10,"dname":"ACCOUNTING","loc":"NEW
YORK","col2":{"deptno":10,"dname":"ACCOUNTING","loc":"NEW YORK"}}
{"deptno":40,"dname":"OPERATIONS","loc":"BOSTON","col2":{"deptno":40,"dname":"OPERATIONS","loc":"BOSTON"}}
{"deptno":20,"dname":"RESEARCH","loc":"DALLAS","col2":{"deptno":20,"dname":"RESEARCH","loc":"DALLAS"}}
{"deptno":30,"dname":"SALES","loc":"CHICAGO","col2":{"deptno":30,"dname":"SALES","loc":"CHICAGO"}}
Time taken: 0.103 seconds, Fetched 4 row(s)
spark-sql (mydb)> SELECT STRUCT(*, STRUCT(dept.*)) AS row_data FROM dept;
{"deptno":10,"dname":"ACCOUNTING","loc":"NEW
YORK","col2":{"deptno":10,"dname":"ACCOUNTING","loc":"NEW YORK"}}
{"deptno":40,"dname":"OPERATIONS","loc":"BOSTON","col2":{"deptno":40,"dname":"OPERATIONS","loc":"BOSTON"}}
{"deptno":20,"dname":"RESEARCH","loc":"DALLAS","col2":{"deptno":20,"dname":"RESEARCH","loc":"DALLAS"}}
{"deptno":30,"dname":"SALES","loc":"CHICAGO","col2":{"deptno":30,"dname":"SALES","loc":"CHICAGO"}}
Time taken: 0.075 seconds, Fetched 4 row(s)
```
--
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]