Uh oh!
There was an error while loading. Please reload this page.
[SPARK-12335][SPARK-12336][SPARK-12341][SPARK-12342][SQL] Fixes several expression nullablility bugs - #10296
Conversation
liancheng
commented
Dec 14, 2015
cc @cloud-fan |
There was a problem hiding this comment.
Should we assign a default value for it? Or I'm afraid it can't compile...
There was a problem hiding this comment.
This should work under standard Java. Will double check how Janino behaves though.
Update: it works as expected.
cloud-fan
commented
Dec 15, 2015
retest this please. |
cloud-fan
commented
Dec 15, 2015
For nested fields, how about improving the |
liancheng
commented
Dec 15, 2015
All |
SparkQA
commented
Dec 15, 2015
Test build #47696 has finished for PR 10296 at commit
|
SparkQA
commented
Dec 15, 2015
Test build #47727 has finished for PR 10296 at commit
|
liancheng
commented
Dec 15, 2015
Didn't add separate test cases for SPARK-12335 and SPARK-12336 since they were caught by existing test cases. |
liancheng
commented
Dec 15, 2015
test this please |
There was a problem hiding this comment.
can we set the corrected join type here?
SparkQA
commented
Dec 15, 2015
Test build #47729 has finished for PR 10296 at commit
|
liancheng
commented
Dec 15, 2015
Hm, seems that this change reveals a lot of other existing nullability bugs... |
SparkQA
commented
Dec 15, 2015
Test build #47730 has finished for PR 10296 at commit
|
There was a problem hiding this comment.
joined.copy(condition = condition)?
1d67016 to
f9638b7CompareThere was a problem hiding this comment.
should we rename this to joinedColsFromRight?
There was a problem hiding this comment.
I think it's OK. The first line of the comment above already explained the purpose of this variable.
SparkQA
commented
Dec 15, 2015
Test build #47736 has finished for PR 10296 at commit
|
SparkQA
commented
Dec 15, 2015
Test build #47737 has finished for PR 10296 at commit
|
cloud-fan
commented
Dec 15, 2015
LGTM, can we fix the nested fields in a follow-up PR? |
cfcc6df to
05c36e5Compareliancheng
commented
Dec 16, 2015
@cloud-fan Yeah, that's the plan. Thanks for the review! |
marmbrus
commented
Dec 16, 2015
Hey guys, I think all this nullability clean up is great, but I afraid that the changes to |
There was a problem hiding this comment.
I think ideally we would not do this check at all when nullable = false.
liancheng
commented
Dec 16, 2015
@marmbrus I also found that So how about updating this PR to only fix all the nullability mismatches without touching |
marmbrus
commented
Dec 16, 2015
That sounds good to me. |
SparkQA
commented
Dec 16, 2015
Test build #47770 has finished for PR 10296 at commit
|
davies
commented
Dec 16, 2015
@liancheng I currently working on nullability of expressions, could you hold this PR a little bit? |
liancheng
commented
Dec 16, 2015
@davies As commented above, I'll reshape this PR to only fix those wrong nullability issues without touching |
SparkQA
commented
Dec 16, 2015
Test build #47808 has finished for PR 10296 at commit
|
SparkQA
commented
Dec 16, 2015
Test build #47807 has finished for PR 10296 at commit
|
liancheng
commented
Dec 16, 2015
retest this please The last build failure seems to be irrelevant. |
liancheng
commented
Dec 16, 2015
@marmbrus Reshaped this PR to only fix those nullability bugs. After some more investigation, now I don't think we can resolve SPARK-12323 by fixing
Since we would like to avoid per row runtime null checking and branching cost (what @davies and @nongli are working on), we'll have to assume the nullability of input data always match the schema of the On the other hand, we can and should ensure nullability of the underlying logical plan is consistent with the Dataset while constructing a Dataset. For example, currently the following case works: valrowRDD= sqlContext.sparkContext.parallelize(Seq(Row("hello"), Row(null)))
valschema=StructType(Seq(StructField("_1", StringType, nullable =false)))
valdf= sqlContext.createDataFrame(rowRDD, schema)
df.as[Tuple1[String]].collect().foreach(println)
// Output://// (hello)// (null)This analysis time checking can be done in |
marmbrus
commented
Dec 16, 2015
You could augment caseclassAssertNotNull(path: String, child: Expression) ...I think there may be some confusion about the schema guarantees for encoders and their expressions. When there is a primitive type, the corresponding
I think it would actually be very good to have assertions that null data does not appear where it is not expected. When we actually start using this information we are almost certainly going to find more places we are not propagating the information correctly. However, we need to ensure that these are elided in production to avoid invalidating the optimization this information is supposed to enable.
I don't agree that you can verify the problem with this code statically. Creating a schema that says that That said, trusting the user to get this right has led to confusion in the past. So I would propose that we do add validations at the |
liancheng
commented
Dec 18, 2015
Closing this one since PR #10333 already covers all the nullability bugs fixed in this one. |
This PR fixes several nullability bugs found while investigationg SPARK-12323.