Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-26680][SPARK-25767][SQL][BACKPORT-2.3] Eagerly create inputVar…
…s while conditions are appropriate ## What changes were proposed in this pull request? Back port of #22789 and #23617 to branch-2.3 When a user passes a Stream to groupBy, ```CodegenSupport.consume``` ends up lazily generating ```inputVars``` from a Stream, since the field ```output``` will be a Stream. At the time ```output.zipWithIndex.map``` is called, conditions are correct. However, by the time the map operation actually executes, conditions are no longer appropriate. The closure used by the map operation ends up using a reference to the partially created ```inputVars```. As a result, a StackOverflowError occurs. This PR ensures that ```inputVars``` is eagerly created while conditions are appropriate. It seems this was also an issue with the code path for creating ```inputVars``` from ```outputVars``` (SPARK-25767). I simply extended the solution for that code path to encompass both code paths. ## How was this patch tested? SQL unit tests new test python tests Closes #23642 from bersprockets/SPARK-26680_branch23. Authored-by: Bruce Robbins <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information