hvanhovell commented on code in PR #47688:
URL: https://github.com/apache/spark/pull/47688#discussion_r1714534304


##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -18669,18 +18665,12 @@ def _invoke_higher_order_function(
 
     :return: a Column
     """
-    from py4j.java_gateway import JVMView
-    from pyspark.sql.classic.column import _to_java_column
+    from pyspark.sql.classic.column import _to_seq, _to_java_column
 
     sc = _get_active_spark_context()
-    expressions = cast(JVMView, 
sc._jvm).org.apache.spark.sql.catalyst.expressions
-    expr = getattr(expressions, name)
-
-    jcols = [_to_java_column(col).expr() for col in cols]
     jfuns = [_create_lambda(f) for f in funs]
-
-    return Column(cast(JVMView, sc._jvm).Column(expr(*jcols + jfuns)))
-
+    jcols = [_to_java_column(c) for c in cols]
+    return Column(sc._jvm.Column.pysparkFn(name, _to_seq(sc, jcols + jfuns)))

Review Comment:
   @HyukjinKwon I cannot invoke `Column.fn(...)` here. Do you know why? I added 
`Column.pysparkFn(...)` as a workaround.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to