GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/15807
[SPARK-18147][SQL] do not fail for very complex aggregator result type
## What changes were proposed in this pull request?
In `TypedAggregateExpression.evaluateExpression`, we may create
`ReferenceToExpressions` with `CreateStruct`, and `CreateStruct` may generate
too many codes and split them into several methods. `ReferenceToExpressions`
will replace `BoundReference` in `CreateStruct` with `LambdaVariable`, which
can only be used as local variables and doesn't work if we split the generated
code.
Instead of fixing `ReferenceToExpressions`, fortunately we can just remove
it.
`ReferenceToExpressions` was introduced in
https://github.com/apache/spark/pull/12067 , to work around a performance issue
about subexpression elimination with whole stage codegen.
Then in https://github.com/apache/spark/pull/12729 we added the support of
subexpression elimination with whole stage codegen, so `ReferenceToExpressions`
is no longer needed.
## How was this patch tested?
new test in `DatasetAggregatorSuite`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark typed-agg
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15807.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15807
----
commit ce6f0ef6ec57309595e00838326ac2f3db499411
Author: Wenchen Fan <[email protected]>
Date: 2016-11-08T07:54:37Z
remove ReferenceToExpressions
commit 39176301aaff89b9c32c6a2baea158e028f22a81
Author: Wenchen Fan <[email protected]>
Date: 2016-11-08T08:16:16Z
add test
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]