danny0405 commented on code in PR #2844:
URL: https://github.com/apache/calcite/pull/2844#discussion_r912957334
##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -1653,6 +1657,108 @@ SqlNode NamedRoutineCall(
}
}
+/**
+ * Table parameter of a table function.
+ * The input table with set semantics may be partitioned/ordered on one or
more columns.
+ */
+SqlNode TableArg() :
+{
Review Comment:
TableArg -> TableParam
##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -1653,6 +1657,108 @@ SqlNode NamedRoutineCall(
}
}
+/**
+ * Table parameter of a table function.
+ * The input table with set semantics may be partitioned/ordered on one or
more columns.
+ */
+SqlNode TableArg() :
+{
+ final Span s;
+ SqlNode tableRef;
+ SqlNodeList partitionList = SqlNodeList.EMPTY;
+ SqlNodeList orderList = SqlNodeList.EMPTY;
+}
+{
+ { s = span(); }
+ tableRef = ExplicitTable(getPos())
+ [
+ <PARTITION> <BY>
+ partitionList = SimpleIdentifierOrList()
+ ]
+ [
+ orderList = OrderByInTableParam()
+ ]
+ {
+ if (partitionList.isEmpty() && orderList.isEmpty()) {
+ return tableRef;
+ } else {
+ return SqlStdOperatorTable.SET_SEMANTICS_TABLE.createCall(
+ s.pos(), tableRef, partitionList, orderList);
+ }
+ }
+}
+
+SqlNode PartitionedQueryOrQueryOrExpr(ExprContext exprContext) :
+{
+ SqlNode e;
+}
+{
+ e = OrderedQueryOrExpr(exprContext)
+ e = PartitionedByAndOrderBy(e)
+
+ { return e; }
+}
+
+SqlNode PartitionedByAndOrderBy(SqlNode e):
+{
+ final Span s;
+ SqlNodeList partitionList = SqlNodeList.EMPTY;
+ SqlNodeList orderList = SqlNodeList.EMPTY;
+}
Review Comment:
The over window also has partition by order by clause, can that parse block
be reused ?
--
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]