xiedeyantu commented on code in PR #5013:
URL: https://github.com/apache/calcite/pull/5013#discussion_r3393872043


##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -4548,12 +4550,42 @@ SqlCall PercentileFunctionCall() :
 }
 
 
+/**
+ * Parses an EXCLUDE or EXCEPT clause following a star inside a ROW 
constructor,
+ * e.g. {@code ROW(* EXCLUDE(col1, col2))} or {@code ROW(t.* EXCEPT(t.col))}.
+ *
+ * @param starIdentifier the star (e.g. "*" or "t.*") that precedes the 
EXCLUDE clause
+ */
+SqlNode RowStarExclude(SqlIdentifier starIdentifier) :
+{
+    SqlIdentifier id;    // current column identifier being parsed
+    final List<SqlNode> list = new ArrayList<SqlNode>();
+    Span s;
+}
+{
+    (<EXCLUDE> | <EXCEPT>)
+    <LPAREN> { s = span(); }
+    id = CompoundIdentifier() { list.add(id); }
+    (
+        <COMMA> id = CompoundIdentifier() { list.add(id); }
+    )*
+    <RPAREN> {
+        final SqlNodeList excludeList = new SqlNodeList(list, s.end(this));
+        return new SqlStarExclude(
+            SqlParserPos.sum(ImmutableList.of(
+                starIdentifier.getParserPosition(),
+                excludeList.getParserPosition())),
+            starIdentifier, excludeList);
+    }
+}
+
 /**
  * Parses an atomic row expression.
  */
 SqlNode AtomicRowExpression() :
 {
     final SqlNode e;
+    SqlNode rowStar;

Review Comment:
   The `SELECT * EXCLUDE` capability won't work in `struct.iq` within the core 
module because the `includeStarExclude` flag is only supported in Babel; 
therefore, I believe none of the current test cases should be supported in 
`struct.iq`. I’m not entirely familiar with `Parser.jj`, but it seems like 
additional flags might be needed for control—and not just there, as the 
subsequent code would also require adjustments—so I’m wondering if we should 
simply remove this flag altogether.
   ```
   <#if (parser.includeStarExclude!default.parser.includeStarExclude)>
       SqlNode rowStar;
   </#if>
   ```



-- 
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]

Reply via email to