dtarima commented on PR #45181:
URL: https://github.com/apache/spark/pull/45181#issuecomment-1968973266
> > df.count() and df.collect().size should always agree.
>
> how about this idea: when calling `df.collect()`, if the plan is cached
but the physical plan is not a cache scan, then we do
`df.select("*").collect()` instead of executing the current physical plan.
Possible, but in my mind it's less robust.
Here is a representation of the consequences from the root cause:
`caching changes the result` -- affects --> `queryExecution caching in
Dataset` -- affects --> `collect()`
I know that `collect()` is not the only affected method: `toLocalIterator()`
is another one - there might exist more we don't know about, and more could be
added in the future. If the root cause is not fixed then there is a high
probability of a similar bug to reappear.
Ideally `caching changes the result` should be fixed. If it's impossible by
some reason then `queryExecution caching in Dataset` would be the next issue to
be fixed.
--
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]