zstan commented on code in PR #13543:
URL: https://github.com/apache/ignite/pull/13543#discussion_r3924678307
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/IgniteTableFunction.java:
##########
@@ -132,4 +145,43 @@ private static void raiseValidationError(Method method,
String errPostfix) {
throw new IgniteSQLException("Unable to create table function for
method '" + mtdSign + "'. " + errPostfix);
}
+
+ /** Returns function parameters represented as SQL types where required. */
+ private static List<FunctionParameter> sqlParameters(Method method,
List<FunctionParameter> functionParameters) {
+ var res = new ArrayList<>(functionParameters);
+
+ for (int i = 0; i < method.getParameterTypes().length; i++) {
+ if (method.getParameterTypes()[i] == byte[].class)
+ res.set(i, sqlBinaryParameter(res.get(i)));
+ }
+
+ return Collections.unmodifiableList(res);
+ }
+
+ /** Prevents Calcite from evaluating binary literals while deriving a
table function row type. */
+ private static FunctionParameter sqlBinaryParameter(FunctionParameter
delegate) {
Review Comment:
I prefer to revise this approach, if it\`s hard to implement now - let\`s
fill an additional issue, thanks !
--
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]