EnricoMi commented on code in PR #38036:
URL: https://github.com/apache/spark/pull/38036#discussion_r992664582


##########
python/pyspark/sql/pandas/group_ops.py:
##########
@@ -366,6 +366,10 @@ class PandasCogroupedOps:
     """
 
     def __init__(self, gd1: "GroupedData", gd2: "GroupedData"):
+        gel1 = gd1._jgd.groupingExprs().length()

Review Comment:
   Expensive because this is calling into the JVM and back, twice?
   
   Later when `def applyInPandas` is called, Python calls into JVM anyway:
   
           jdf = self._gd1._jgd.flatMapCoGroupsInPandas(self._gd2._jgd, 
udf_column._jc.expr())
   
   So this could be moved into `private[sql] def flatMapCoGroupsInPandas`.



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