Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16995][SQL] TreeNodeException when flat mapping RelationalGroupedDataset created from DataFrame containing a column created with lit/expr - #14648
Conversation
SparkQA
commented
Aug 15, 2016
Test build #63786 has finished for PR 14648 at commit
|
viirya
commented
Aug 16, 2016
cc @cloud-fan |
| // Operators that operate on objects should only have expressions from encoders, which | ||
| // should never have foldable expressions. | ||
| case o: ObjectConsumer => o |
There was a problem hiding this comment.
we should follow other cases, to set stop to true
There was a problem hiding this comment.
Ok. I will update once I return back to laptop.
SparkQA
commented
Aug 16, 2016
Test build #63838 has finished for PR 14648 at commit
|
viirya
commented
Aug 16, 2016
retest this please. |
SparkQA
commented
Aug 16, 2016
Test build #63845 has finished for PR 14648 at commit
|
| case o: ObjectProducer => | ||
| stop = true | ||
| o | ||
| case a: AppendColumns => |
There was a problem hiding this comment.
After think about it more, I think the foldable propagation is still useful for object operators like DeserializeToObject, how about we specify the problematic cases here explicitly? i.e. MapGroups, FlatMapGroupsInR, CoGroup
There was a problem hiding this comment.
You mean deserializer in DeserializeToObject can still contain foldable expressions?
There was a problem hiding this comment.
It can, if the referenced column is a literal.
SparkQA
commented
Aug 17, 2016
Test build #63892 has finished for PR 14648 at commit
|
| import df.sparkSession.implicits._ | ||
| assertResult(Seq()) { |
commented
Aug 18, 2016
Test build #63962 has finished for PR 14648 at commit
|
commented
Aug 18, 2016
thanks, merging to master and 2.0! |
commented
Aug 18, 2016
Thanks for review. |
What changes were proposed in this pull request?
A TreeNodeException is thrown when executing the following minimal example in Spark 2.0.
The problem is at
FoldablePropagation. The rule will dotransformExpressionsonLogicalPlan. The query above contains aMapGroupswhich has a parameterdataAttributes:Seq[Attribute]. One attributes indataAttributeswill be transformed to anAlias(literal(0), _)inFoldablePropagation.Aliasis not anAttributeand causes the error.We can't easily detect such type inconsistency during transforming expressions. A direct approach to this problem is to skip doing
FoldablePropagationon object operators as they should not contain such expressions.How was this patch tested?
Jenkins tests.