Skip to content

Conversation

@hvanhovell
Copy link
Contributor

What changes were proposed in this pull request?

The FoldablePropagation optimizer rule, pulls foldable values out from under an Expand. This breaks the Expand in two ways:

  • It rewrites the output attributes of the Expand. We explicitly define output attributes for Expand, these are (unfortunately) considered as part of the expressions of the Expand and can be rewritten.
  • Expand can actually change the column (it will typically re-use the attributes or the underlying plan). This means that we cannot safely propagate the expressions from under an Expand.

This PR fixes this and (hopefully) other issues by explicitly whitelisting allowed operators.

This is a backport of #15857

How was this patch tested?

Added tests to FoldablePropagationSuite and to SQLQueryTestSuite.

@hvanhovell
Copy link
Contributor Author

cc @gatorsmile

@gatorsmile
Copy link
Member

LGTM

@SparkQA
Copy link

SparkQA commented Nov 16, 2016

Test build #68677 has finished for PR 15892 at commit 7911feb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Nov 16, 2016

Merging in.

Can you close the ticket?

asfgit pushed a commit that referenced this pull request Nov 16, 2016
… child [BRANCH-2.0]

## What changes were proposed in this pull request?
The `FoldablePropagation` optimizer rule, pulls foldable values out from under an `Expand`. This breaks the `Expand` in two ways:

- It rewrites the output attributes of the `Expand`. We explicitly define output attributes for `Expand`, these are (unfortunately) considered as part of the expressions of the `Expand` and can be rewritten.
- Expand can actually change the column (it will typically re-use the attributes or the underlying plan). This means that we cannot safely propagate the expressions from under an `Expand`.

This PR fixes this and (hopefully) other issues by explicitly whitelisting allowed operators.

This is a backport of #15857

## How was this patch tested?
Added tests to `FoldablePropagationSuite` and to `SQLQueryTestSuite`.

Author: Herman van Hovell <[email protected]>

Closes #15892 from hvanhovell/SPARK-18300-branch-2.0.
@hvanhovell hvanhovell closed this Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants