-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-15140][SQL] make the semantics of null input object for encoder clear #13469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to also disallow null input object for flat type, but failed as some other tests already depend on this feature. e.g. ParquetIOSuite.null and non-null strings
|
Test build #59854 has finished for PR 13469 at commit
|
|
Test build #59860 has finished for PR 13469 at commit
|
| inputObject | ||
| } else { | ||
| // For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL | ||
| // doesn't allow row to be null, only its columns can be null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... doesn't allow top-level row to be null, ...
|
LGTM except for minor comments. |
|
Let's wait for #13269 first. |
|
LGTM pending Jenkins. |
|
Test build #59941 has finished for PR 13469 at commit
|
|
Merging to master and branch-2.0. |
…r clear ## What changes were proposed in this pull request? For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow row to be null, only its columns can be null. This PR explicitly add this constraint and throw exception if users break it. ## How was this patch tested? several new tests Author: Wenchen Fan <[email protected]> Closes #13469 from cloud-fan/null-object. (cherry picked from commit 11c83f8) Signed-off-by: Cheng Lian <[email protected]>
## What changes were proposed in this pull request? For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow the entire row to be null, only its columns can be null. That's the reason we forbid users to use top level null objects in #13469 However, if users wrap non-flat type with `Option`, then we may still encoder top level null object to row, which is not allowed. This PR fixes this case, and suggests users to wrap their type with `Tuple1` if they do wanna top level null objects. ## How was this patch tested? new test Author: Wenchen Fan <[email protected]> Closes #15979 from cloud-fan/option.
## What changes were proposed in this pull request? For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow the entire row to be null, only its columns can be null. That's the reason we forbid users to use top level null objects in #13469 However, if users wrap non-flat type with `Option`, then we may still encoder top level null object to row, which is not allowed. This PR fixes this case, and suggests users to wrap their type with `Tuple1` if they do wanna top level null objects. ## How was this patch tested? new test Author: Wenchen Fan <[email protected]> Closes #15979 from cloud-fan/option. (cherry picked from commit f135b70) Signed-off-by: Cheng Lian <[email protected]>
## What changes were proposed in this pull request? For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow the entire row to be null, only its columns can be null. That's the reason we forbid users to use top level null objects in apache#13469 However, if users wrap non-flat type with `Option`, then we may still encoder top level null object to row, which is not allowed. This PR fixes this case, and suggests users to wrap their type with `Tuple1` if they do wanna top level null objects. ## How was this patch tested? new test Author: Wenchen Fan <[email protected]> Closes apache#15979 from cloud-fan/option.
## What changes were proposed in this pull request? For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow the entire row to be null, only its columns can be null. That's the reason we forbid users to use top level null objects in apache#13469 However, if users wrap non-flat type with `Option`, then we may still encoder top level null object to row, which is not allowed. This PR fixes this case, and suggests users to wrap their type with `Tuple1` if they do wanna top level null objects. ## How was this patch tested? new test Author: Wenchen Fan <[email protected]> Closes apache#15979 from cloud-fan/option.
What changes were proposed in this pull request?
For input object of non-flat type, we can't encode it to row if it's null, as Spark SQL doesn't allow row to be null, only its columns can be null.
This PR explicitly add this constraint and throw exception if users break it.
How was this patch tested?
several new tests