BryanCutler commented on a change in pull request #23739:
[SPARK-26832][SQL][PYTHON] Avoid project creation per record at Python's
grouped vectorized UDF
URL: https://github.com/apache/spark/pull/23739#discussion_r254515364
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/python/FlatMapGroupsInPandasExec.scala
##########
@@ -145,7 +145,8 @@ case class FlatMapGroupsInPandasExec(
sessionLocalTimeZone,
pythonRunnerConf).compute(grouped, context.partitionId(), context)
-
columnarBatchIter.flatMap(_.rowIterator.asScala).map(UnsafeProjection.create(output,
output))
Review comment:
@HyukjinKwon I could be wrong, but I believe
`UnsafeProjection.create(output, output)` creates the function before it is
executed by map, so it's only done once. If it was `map(_ =>
UnsafeProjection.create(output, output)` then it would get created a bunch of
times. Maybe I am missing something tho?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]