-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21904] [SQL] Rename tempTables to tempViews in SessionCatalog #19117
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
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 |
|---|---|---|
|
|
@@ -795,7 +795,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | |
| checkAnswer(spark.table("teachers"), df) | ||
| } | ||
|
|
||
| test("rename temporary table - destination table with database name") { | ||
| test("rename temporary view - destination table with database name") { | ||
| withTempView("tab1") { | ||
| sql( | ||
| """ | ||
|
|
@@ -812,15 +812,15 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | |
| sql("ALTER TABLE tab1 RENAME TO default.tab2") | ||
| } | ||
| assert(e.getMessage.contains( | ||
| "RENAME TEMPORARY TABLE from '`tab1`' to '`default`.`tab2`': " + | ||
| "RENAME TEMPORARY VIEW from '`tab1`' to '`default`.`tab2`': " + | ||
|
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. We can rename this test name from |
||
| "cannot specify database name 'default' in the destination table")) | ||
|
|
||
| val catalog = spark.sessionState.catalog | ||
|
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. At L823 there is a test named |
||
| assert(catalog.listTables("default") == Seq(TableIdentifier("tab1"))) | ||
| } | ||
| } | ||
|
|
||
| test("rename temporary table") { | ||
| test("rename temporary view") { | ||
| withTempView("tab1", "tab2") { | ||
| spark.range(10).createOrReplaceTempView("tab1") | ||
| sql("ALTER TABLE tab1 RENAME TO tab2") | ||
|
|
@@ -832,7 +832,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | |
| } | ||
| } | ||
|
|
||
| test("rename temporary table - destination table already exists") { | ||
| test("rename temporary view - destination table already exists") { | ||
| withTempView("tab1", "tab2") { | ||
| sql( | ||
| """ | ||
|
|
@@ -860,7 +860,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | |
| sql("ALTER TABLE tab1 RENAME TO tab2") | ||
| } | ||
| assert(e.getMessage.contains( | ||
| "RENAME TEMPORARY TABLE from '`tab1`' to '`tab2`': destination table already exists")) | ||
| "RENAME TEMPORARY VIEW from '`tab1`' to '`tab2`': destination table already exists")) | ||
|
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. ditto. This test name is also |
||
|
|
||
| val catalog = spark.sessionState.catalog | ||
| assert(catalog.listTables("default") == Seq(TableIdentifier("tab1"), TableIdentifier("tab2"))) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
The code comment at the beginning of
SessionCatalogalso includes wording...it also manages temporary tables and ...