-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-15367] [SQL] Add refreshTable back #13156
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
Changes from all commits
b1cd1c6
bdd7c61
e3564d5
c3f3f0b
9e6c4b7
5f342f7
4ac3b76
7142ef5
8a52ac6
2b773b8
20d5055
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,4 +58,16 @@ class HiveContext private[hive]( | |
| sparkSession.sharedState.asInstanceOf[HiveSharedState] | ||
| } | ||
|
|
||
| /** | ||
| * Invalidate and refresh all the cached the metadata of the given table. For performance reasons, | ||
| * Spark SQL or the external data source library it uses might cache certain metadata about a | ||
| * table, such as the location of blocks. When those change outside of Spark SQL, users should | ||
| * call this function to invalidate the cache. | ||
| * | ||
| * @since 1.3.0 | ||
| */ | ||
| def refreshTable(tableName: String): Unit = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class is for the compatibility purpose. Let's leave it as is.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
| sparkSession.catalog.refreshTable(tableName) | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we don't call
refreshTablethroughSessionState, do we still need to keepSessionState.refreshTable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I also want to remove
invalidateTable, which is a duplicate name ofrefreshTableThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, invalidateTable and refreshTable do have different meanings. The current implementation of
HiveMetastoreCatalog.refreshTableisHiveMetastoreCatalog.invalidateTable(and then we retrieve the new metadata lazily). But, it does not mean thatrefreshTableandinvalidateTablehave the same semantic. If we should remove any ofinvalidateTableorrefreshTableshould be discussed in a different thread.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks!