Skip to content

[SPARK-19756][SQL] drop the table cache after inserting into a data source table#17089

Closed
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:minor
Closed

[SPARK-19756][SQL] drop the table cache after inserting into a data source table#17089
cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan:minor

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

When we inserting into a table, we should uncache it to avoid exposing stale data. This is the existing behavior for hive tables, see InsertIntoHiveTable, this PR fixes this problem for data source tables.

How was this patch tested?

new regression test

@cloud-fan
Copy link
Contributor Author

cc @gatorsmile

@SparkQA
Copy link

SparkQA commented Feb 28, 2017

Test build #73541 has started for PR 17089 at commit 8bca8d3.

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending Jenkins.


fileIndex.foreach(_.refresh())
catalogTable.foreach { table =>
sparkSession.sharedState.cacheManager.uncacheQuery(sparkSession.table(table.identifier))
Copy link
Contributor

@windpiger windpiger Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncache it or refresh it use refreshByPath?
In this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR can make the behavior consistent with what we did for insertion of Hive serve tables

Copy link
Contributor

@windpiger windpiger Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Feb 28, 2017

Test build #73564 has finished for PR 17089 at commit 8bca8d3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor Author

closing in favor of #16809

@cloud-fan cloud-fan closed this Feb 28, 2017
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