fdolce commented on code in PR #30095:
URL: https://github.com/apache/flink/pull/30095#discussion_r4710609803
##########
flink-python/pyflink/table/expression.py:
##########
@@ -275,6 +275,15 @@ def _get_java_expression(expr, to_expr: bool = False):
return expr
+def _to_java_varargs(args):
+ """
+ Packs the given arguments into a Java Object[], as py4j does not do this
for a Java varargs
+ parameter.
+ """
+ gateway = get_gateway()
+ return to_jarray(gateway.jvm.Object, [_get_java_expression(arg) for arg in
args])
Review Comment:
Yep, turns out also `array_concat`, `map_union`, `array_distinct`,
`array_reverse` and `array_slice` have similar issues, added tests and fixed
those.
Also `array_join` and `array_sort` are broken, but not for the same reason.
They try to call functions that don't actually exist on the java api if I'm
reading this correctly. I think we can have a fix on the python side using
`call("ARRAY_JOIN", ...)`, but probably the proper fix is to add the functions
to `BaseExpression` right?
--
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]