forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-40670][SS][PYTHON] Fix NPE in applyInPandasWithState when the …
…input schema has "non-nullable" column(s) ### What changes were proposed in this pull request? This PR fixes a bug which occurs NPE when the input schema of applyInPandasWithState has "non-nullable" column(s). This PR also leaves a code comment explaining the fix. Quoting: ``` // See processTimedOutState: we create a row which contains the actual values for grouping key, // but all nulls for value side by intention. This technically changes the schema of input to // be "nullable", hence the schema information and the internal projection of row should take // this into consideration. Strictly saying, it's not applied to the part of grouping key, but // it doesn't hurt much even if we apply the same for grouping key as well. ``` ### Why are the changes needed? There's a bug which we didn't take the non-null columns into account. This PR fixes the bug. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New UT. The new test case failed with NPE without the fix, and succeeded with the fix. Closes apache#38115 from HeartSaVioR/SPARK-40670. Authored-by: Jungtaek Lim <[email protected]> Signed-off-by: Jungtaek Lim <[email protected]>
- Loading branch information
1 parent
5523972
commit edd6076
Showing
2 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters