Uh oh!
There was an error while loading. Please reload this page.
[SPARK-24165][SQL][branch-2.3] Fixing conditional expressions to handle nullability of nested types - #21747
[SPARK-24165][SQL][branch-2.3] Fixing conditional expressions to handle nullability of nested types#21747mn-mikke wants to merge 3 commits into
Conversation
…le nullability of nested types
mn-mikke
commented
Jul 11, 2018
SparkQA
commented
Jul 11, 2018
Test build #92856 has finished for PR 21747 at commit
|
mn-mikke
commented
Jul 11, 2018
retest this please |
| * data types of all child expressions. The collection must not be empty. | ||
| */ | ||
| @transient | ||
| lazy val inputTypesForMerging: Seq[DataType] = children.map(_.dataType) |
| StructType(newFields) | ||
| } | ||
| override def dataType: DataType = { |
There was a problem hiding this comment.
Can't we change def into lazy val? I feel a little weird that the two requirement checks are invoked every dataType called.
| extends ComplexTypeMergingExpression { | ||
| @transient | ||
| override lazy val inputTypesForMerging: Seq[DataType] = { |
SparkQA
commented
Jul 11, 2018
Test build #92859 has finished for PR 21747 at commit
|
cloud-fan
commented
Jul 11, 2018
retest this please |
SparkQA
commented
Jul 11, 2018
Test build #92862 has finished for PR 21747 at commit
|
cloud-fan
commented
Jul 12, 2018
retest this please |
1 similar comment
cloud-fan
commented
Jul 12, 2018
retest this please |
SparkQA
commented
Jul 12, 2018
Test build #92912 has finished for PR 21747 at commit
|
maropu
commented
Jul 12, 2018
retest this please |
mn-mikke
commented
Jul 12, 2018
Thanks guys for triggering the builds, but I must implement a fix first. It's failing since the code is accessing |
SparkQA
commented
Jul 12, 2018
Test build #92914 has finished for PR 21747 at commit
|
SparkQA
commented
Jul 12, 2018
Test build #92925 has finished for PR 21747 at commit
|
cloud-fan
commented
Jul 12, 2018
ah, that's hard to fix, maybe just leave it, since Spark 2.4 is coming. |
|
mn-mikke
commented
Jul 12, 2018
IMHO, we could directly use If you don't like this approach for any reason, I'm happy to close the PR. :-) |
SparkQA
commented
Jul 12, 2018
Test build #92933 has finished for PR 21747 at commit
|
AmplabJenkins
commented
Sep 23, 2018
Can one of the admins verify this patch? |
dongjoon-hyun
commented
Sep 23, 2018
Hi, @mn-mikke and @cloud-fan and @maropu .
|
mn-mikke
commented
Sep 24, 2018
If nobody has any objections, I'm happy to close this PR. |
cloud-fan
commented
Sep 24, 2018
To backport this fix, we need to backport another improvement PR that allows accessing SQLConf at executor side, which violates the backport rule. I think it's ok to have this fix in 2.4 only. |
dongjoon-hyun
commented
Sep 24, 2018
Thank you for the decision, @mn-mikke and @cloud-fan ! |
What changes were proposed in this pull request?
This PR is proposing a fix for the output data type of
IfandCaseWhenexpression. Upon till now, the implementation of exprassions has ignored nullability of nested types from different execution branches and returned the type of the first branch.This could lead to an unwanted
NullPointerExceptionfrom other expressions depending on aIf/CaseWhenexpression.Example:
Exception:
Output schema:
How was this patch tested?
New test cases added into