-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-15204][SQL] improve nullability inference for Aggregator #13532
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
[SPARK-15204][SQL] improve nullability inference for Aggregator #13532
Conversation
|
cc @cloud-fan |
|
Test build #60068 has finished for PR 13532 at commit
|
| outputEncoder.deserializer.dataType, | ||
| outputType) | ||
| outputType, | ||
| outputNullable) |
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 think we can just do: !outputEncoder.flat || outputEncoder.schema.head.nullable
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.
ok
|
Test build #60083 has finished for PR 13532 at commit
|
|
can we wait for #13553? thanks! |
|
Test build #61667 has finished for PR 13532 at commit
|
| val ds1 = Seq(1, 3, 2, 5).toDS() | ||
| assert(ds1.select(typed.sum((i: Int) => i)).schema.head.nullable === false) | ||
| val ds2 = Seq(AggData(1, "a"), AggData(2, "a")).toDS() | ||
| assert(ds2.groupByKey(_.b).agg(SeqAgg.toColumn).schema(1).nullable === true) |
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.
should we use ds.select for all tests? And we should also test String, which is flat but nullable.
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.
the last assert with NameAgg tests String as output of the Aggregator. is that good enough?
|
Test build #61697 has finished for PR 13532 at commit
|
|
merging to master, thanks! |
What changes were proposed in this pull request?
TypedAggregateExpression sets nullable based on the schema of the outputEncoder
How was this patch tested?
Add test in DatasetAggregatorSuite