Skip to content
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-22637][SQL] Only refresh a logical plan once. #19837

Closed
wants to merge 1 commit into from

Conversation

hvanhovell
Copy link
Contributor

What changes were proposed in this pull request?

CatalogImpl.refreshTable uses foreach(..) to refresh all tables in a view. This traverses all nodes in the subtree and calls LogicalPlan.refresh() on these nodes. However LogicalPlan.refresh() is also refreshing its children, as a result refreshing a large view can be quite expensive.

This PR just calls LogicalPlan.refresh() on the top node.

How was this patch tested?

Existing tests.

@hvanhovell
Copy link
Contributor Author

cc @gatorsmile can you take a look?

@gatorsmile
Copy link
Member

LGTM

@SparkQA
Copy link

SparkQA commented Nov 28, 2017

Test build #84273 has finished for PR 19837 at commit 9c7a45c.

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

asfgit pushed a commit that referenced this pull request Nov 29, 2017
## What changes were proposed in this pull request?
`CatalogImpl.refreshTable` uses `foreach(..)` to refresh all tables in a view. This traverses all nodes in the subtree and calls `LogicalPlan.refresh()` on these nodes. However `LogicalPlan.refresh()` is also refreshing its children, as a result refreshing a large view can be quite expensive.

This PR just calls `LogicalPlan.refresh()` on the top node.

## How was this patch tested?
Existing tests.

Author: Herman van Hovell <hvanhovell@databricks.com>

Closes #19837 from hvanhovell/SPARK-22637.

(cherry picked from commit 475a29f)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
@gatorsmile
Copy link
Member

Thanks! Merged to master/2.2

@asfgit asfgit closed this in 475a29f Nov 29, 2017
MatthewRBruce pushed a commit to Shopify/spark that referenced this pull request Jul 31, 2018
## What changes were proposed in this pull request?
`CatalogImpl.refreshTable` uses `foreach(..)` to refresh all tables in a view. This traverses all nodes in the subtree and calls `LogicalPlan.refresh()` on these nodes. However `LogicalPlan.refresh()` is also refreshing its children, as a result refreshing a large view can be quite expensive.

This PR just calls `LogicalPlan.refresh()` on the top node.

## How was this patch tested?
Existing tests.

Author: Herman van Hovell <hvanhovell@databricks.com>

Closes apache#19837 from hvanhovell/SPARK-22637.

(cherry picked from commit 475a29f)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants