vvysotskyi commented on a change in pull request #1837: [CALCITE-3835]
Overloaded table functions fail with an assertion error if param types differ
URL: https://github.com/apache/calcite/pull/1837#discussion_r399104681
##########
File path: core/src/test/java/org/apache/calcite/util/Smalls.java
##########
@@ -843,6 +843,30 @@ private void abc(StringBuilder sb, Object s) {
}
}
+ /** User-defined table-macro function with named and optional parameters. */
+ public static class AnotherTableMacroFunctionWithNamedParameters {
+ public TranslatableTable eval(
+ @Parameter(name = "R", optional = true) String r,
+ @Parameter(name = "S") String s,
+ @Parameter(name = "T", optional = true) Integer t,
+ @Parameter(name = "S2", optional = true) String s2) {
+ final StringBuilder sb = new StringBuilder();
+ abc(sb, r);
+ abc(sb, s);
+ abc(sb, t);
Review comment:
In this case, will be used the first registered function. Here is the code
which returns it:
https://github.com/apache/calcite/blob/1baee8524a8daa9c67f08f83080e269fc5938bc5/core/src/main/java/org/apache/calcite/sql/SqlUtil.java#L451
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services