Uh oh!
There was an error while loading. Please reload this page.
[SPARK-26637][SQL] Makes GetArrayItem nullability more precise - #23566
Closed
maropu wants to merge 3 commits into
Closed
[SPARK-26637][SQL] Makes GetArrayItem nullability more precise#23566maropu wants to merge 3 commits into
maropu wants to merge 3 commits into
Conversation
SparkQA
commented
Jan 16, 2019
Test build #101316 has finished for PR 23566 at commit
|
| ar(intOrdinal).nullable | ||
| case GetArrayStructFields(CreateArray(ar), _, _, _, containsNull) | ||
| if intOrdinal < ar.length => | ||
| containsNull |
Contributor
There was a problem hiding this comment.
case GetArrayStructFields(CreateArray(elements), field, _, _, _) if intOrdinal < elements.length =>
elements(i).nullable || field.nullable
SparkQA
commented
Jan 21, 2019
Test build #101475 has finished for PR 23566 at commit
|
maropuforce-pushed
the
GetArrayItemNullability
branch
from
January 22, 2019 01:05
1f9106f to
40a598dCompare| val f2 = StructField("b", IntegerType, nullable = true) | ||
| val structType = StructType(f1 :: f2 :: Nil) | ||
| val c = AttributeReference("c", structType, nullable = false)() | ||
| val stArray1 = GetArrayStructFields(CreateArray(c :: Nil), f1, 0, 2, containsNull = f1.nullable) |
Contributor
There was a problem hiding this comment.
containsNull should be c.nullable, according to the logic in ExtractValue.apply.
SparkQA
commented
Jan 22, 2019
Test build #101503 has finished for PR 23566 at commit
|
| val d = AttributeReference("d", structType, nullable = true)() | ||
| val stArray3 = GetArrayStructFields(CreateArray(c :: d :: Nil), f1, 0, 2, | ||
| containsNull = f1.nullable) |
cloud-fan
approved these changes
Jan 22, 2019
SparkQA
commented
Jan 22, 2019
Test build #101532 has finished for PR 23566 at commit
|
cloud-fan
commented
Jan 23, 2019
Contributor
thanks, merging to master! |
dongjoon-hyun pushed a commit
that referenced
this pull request
Jan 28, 2019
## What changes were proposed in this pull request? In master, `GetMapValue` nullable is always true; https://github.com/apache/spark/blob/cf133e611020ed178f90358464a1b88cdd9b7889/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala#L371 But, If input key is foldable, we could make its nullability more precise. This fix is the same with SPARK-26637(#23566). ## How was this patch tested? Added tests in `ComplexTypeSuite`. Closes#23669 from maropu/SPARK-26747. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
jackylee-ch pushed a commit
to jackylee-ch/spark
that referenced
this pull request
Feb 18, 2019
## What changes were proposed in this pull request? In the master, GetArrayItem nullable is always true; https://github.com/apache/spark/blob/cf133e611020ed178f90358464a1b88cdd9b7889/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala#L236 But, If input array size is constant and ordinal is foldable, we could make GetArrayItem nullability more precise. This pr added code to make `GetArrayItem` nullability more precise. ## How was this patch tested? Added tests in `ComplexTypeSuite`. Closesapache#23566 from maropu/GetArrayItemNullability. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
jackylee-ch pushed a commit
to jackylee-ch/spark
that referenced
this pull request
Feb 18, 2019
## What changes were proposed in this pull request? In master, `GetMapValue` nullable is always true; https://github.com/apache/spark/blob/cf133e611020ed178f90358464a1b88cdd9b7889/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala#L371 But, If input key is foldable, we could make its nullability more precise. This fix is the same with SPARK-26637(apache#23566). ## How was this patch tested? Added tests in `ComplexTypeSuite`. Closesapache#23669 from maropu/SPARK-26747. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
cloud-fan pushed a commit
that referenced
this pull request
Mar 4, 2019
… cases ## What changes were proposed in this pull request? In master, `ElementAt` nullable is always true; https://github.com/apache/spark/blob/be1cadf16dc70e22eae144b3dfce9e269ef95acc/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala#L1977 But, If input is an array and foldable, we could make its nullability more precise. This fix is based on SPARK-26637(#23566). ## How was this patch tested? Added tests in `CollectionExpressionsSuite`. Closes#23867 from maropu/SPARK-26965. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
This file contains hidden or 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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In the master, GetArrayItem nullable is always true;
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala
Line 236 in cf133e6
But, If input array size is constant and ordinal is foldable, we could make GetArrayItem nullability more precise. This pr added code to make
GetArrayItemnullability more precise.How was this patch tested?
Added tests in
ComplexTypeSuite.