-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b1cd1c6
initial fix
gatorsmile bdd7c61
fix.
gatorsmile e3564d5
fix again.
gatorsmile c3f3f0b
revert it back
gatorsmile 9e6c4b7
Merge remote-tracking branch 'upstream/master' into refreshTable
gatorsmile 5f342f7
address comments.
gatorsmile 4ac3b76
Merge remote-tracking branch 'upstream/master' into refreshTable
gatorsmile 7142ef5
address comments
gatorsmile 8a52ac6
update the comment.
gatorsmile 2b773b8
remove the test
gatorsmile 20d5055
remove refreshTable
gatorsmile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,7 +202,8 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
|
|
||
| activateDatabase(db) { | ||
| sql( | ||
| s"""CREATE EXTERNAL TABLE t (id BIGINT) | ||
| s""" | ||
| |CREATE EXTERNAL TABLE t (id BIGINT) | ||
|
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. Seems these formatting changes are not necessary?
Member
Author
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. Will revert them back. Thanks! |
||
| |PARTITIONED BY (p INT) | ||
| |STORED AS PARQUET | ||
| |LOCATION '$path' | ||
|
|
@@ -217,7 +218,7 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
|
|
||
| df.write.parquet(s"$path/p=2") | ||
| sql("ALTER TABLE t ADD PARTITION (p=2)") | ||
| hiveContext.sessionState.refreshTable("t") | ||
| hiveContext.refreshTable("t") | ||
| checkAnswer( | ||
| spark.table("t"), | ||
| df.withColumn("p", lit(1)).union(df.withColumn("p", lit(2)))) | ||
|
|
@@ -234,11 +235,12 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
| val path = dir.getCanonicalPath | ||
|
|
||
| sql( | ||
| s"""CREATE EXTERNAL TABLE $db.t (id BIGINT) | ||
| |PARTITIONED BY (p INT) | ||
| |STORED AS PARQUET | ||
| |LOCATION '$path' | ||
| """.stripMargin) | ||
| s""" | ||
| |CREATE EXTERNAL TABLE $db.t (id BIGINT) | ||
| |PARTITIONED BY (p INT) | ||
| |STORED AS PARQUET | ||
| |LOCATION '$path' | ||
| """.stripMargin) | ||
|
|
||
| checkAnswer(spark.table(s"$db.t"), spark.emptyDataFrame) | ||
|
|
||
|
|
@@ -249,7 +251,7 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
|
|
||
| df.write.parquet(s"$path/p=2") | ||
| sql(s"ALTER TABLE $db.t ADD PARTITION (p=2)") | ||
| hiveContext.sessionState.refreshTable(s"$db.t") | ||
| hiveContext.refreshTable(s"$db.t") | ||
| checkAnswer( | ||
| spark.table(s"$db.t"), | ||
| df.withColumn("p", lit(1)).union(df.withColumn("p", lit(2)))) | ||
|
|
@@ -279,11 +281,11 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
| val message = intercept[AnalysisException] { | ||
| sql( | ||
| s""" | ||
| |CREATE TABLE `d:b`.`t:a` (a int) | ||
| |USING parquet | ||
| |OPTIONS ( | ||
| | path '$path' | ||
| |) | ||
| |CREATE TABLE `d:b`.`t:a` (a int) | ||
| |USING parquet | ||
| |OPTIONS ( | ||
| | path '$path' | ||
| |) | ||
| """.stripMargin) | ||
| }.getMessage | ||
| assert(message.contains("is not a valid name for metastore")) | ||
|
|
@@ -293,12 +295,12 @@ class MultiDatabaseSuite extends QueryTest with SQLTestUtils with TestHiveSingle | |
| val message = intercept[AnalysisException] { | ||
| sql( | ||
| s""" | ||
| |CREATE TABLE `d:b`.`table` (a int) | ||
| |USING parquet | ||
| |OPTIONS ( | ||
| | path '$path' | ||
| |) | ||
| """.stripMargin) | ||
| |CREATE TABLE `d:b`.`table` (a int) | ||
| |USING parquet | ||
| |OPTIONS ( | ||
| | path '$path' | ||
| |) | ||
| """.stripMargin) | ||
| }.getMessage | ||
| assert(message.contains("is not a valid name for metastore")) | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This method did not exist in SQLContext. It's in HiveContext.
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.
Sure, will remove it. Thanks!