Uh oh!
There was an error while loading. Please reload this page.
[SPARK-27778][PYTHON] Fix toPandas conversion of empty DataFrame with Arrow enabled - #24650
[SPARK-27778][PYTHON] Fix toPandas conversion of empty DataFrame with Arrow enabled#24650dvogelbacher wants to merge 5 commits into
Conversation
dvogelbacher
commented
May 20, 2019
@BryanCutler can you take a look at this one |
BryanCutler
left a comment
There was a problem hiding this comment.
Thanks for catching this @dvogelbacher !
Uh oh!
There was an error while loading. Please reload this page.
BryanCutler
commented
May 20, 2019
ok to test |
SparkQA
commented
May 21, 2019
Test build #105580 has finished for PR 24650 at commit
|
| 0 until numPartitions, | ||
| handlePartitionBatches) | ||
| if (numPartitions == 0) { |
There was a problem hiding this comment.
This method is well-commented. Can you add another comment that we should end stream when partitions are empty?
Also, I would do:
partitions =0 until numPartitions
sparkSession.sparkContext.runJob(
arrowBatchRdd,
(ctx: TaskContext, it: Iterator[Array[Byte]]) => it.toArray,
partitions,
handlePartitionBatches)
if (partitions.isEmpty) {
// Currently result handler is not called when given partitions are empty.// Therefore, we should end stream here.
doAfterLastPartition()
}HyukjinKwon
commented
May 21, 2019
Looks fine given skimming the codes. |
SparkQA
commented
May 21, 2019
Test build #105588 has finished for PR 24650 at commit
|
BryanCutler
commented
May 21, 2019
I had another thought about this, the stuff in It also has the benefit that the number of partitions would not have to be kept track of, so the variables What do you think @dvogelbacher and @HyukjinKwon ? |
HyukjinKwon
commented
May 21, 2019
Yea, SGTM. |
dvogelbacher
commented
May 21, 2019
yes, that's a good idea @BryanCutler, it is much clearer. I've made the change. |
SparkQA
commented
May 21, 2019
Test build #105619 has finished for PR 24650 at commit
|
BryanCutler
left a comment
There was a problem hiding this comment.
Looks pretty good now, just a couple more minor things that could be done to clean it up a bit more if you wouldn't mind.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dvogelbacher
commented
May 22, 2019
of course, I addressed the comments @BryanCutler |
HyukjinKwon
left a comment
There was a problem hiding this comment.
Yea, this way looks better. Looks good to me too
SparkQA
commented
May 22, 2019
Test build #105647 has finished for PR 24650 at commit
|
HyukjinKwon
commented
May 22, 2019
Merged to master. |
What changes were proposed in this pull request?
#22275 introduced a performance improvement where we send partitions out of order to python and then, as a last step, send the partition order as well.
However, if there are no partitions we will never send the partition order and we will get an "EofError" on the python side.
This PR fixes this by also sending the partition order if there are no partitions present.
How was this patch tested?
New unit test added.