-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29522][SQL] CACHE TABLE should look up catalog/table like v2 commands #26179
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
Conversation
|
Test build #112333 has finished for PR 26179 at commit
|
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statements.scala
Outdated
Show resolved
Hide resolved
|
Test build #112347 has finished for PR 26179 at commit
|
|
Test build #112348 has finished for PR 26179 at commit
|
| } | ||
|
|
||
| /** | ||
| <<<<<<< HEAD |
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.
remove?
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.
oops
| val query = Option(ctx.query).map(plan) | ||
| val tableName = visitMultipartIdentifier(ctx.multipartIdentifier) | ||
| if (query.isDefined && tableName.length > 1) { | ||
| val catalogAndDatabase = tableName.init.mkString(".") |
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.
catalogAndNamespace
| val query = Option(ctx.query).map(plan) | ||
| val tableName = visitMultipartIdentifier(ctx.multipartIdentifier) | ||
| if (query.isDefined && tableName.length > 1) { | ||
| val catalogAndDatabase = tableName.init.mkString(".") |
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.
use MultipartIdentifierHelper.quoted?
| val tableName = visitMultipartIdentifier(ctx.multipartIdentifier) | ||
| if (query.isDefined && tableName.length > 1) { | ||
| val catalogAndDatabase = tableName.init.mkString(".") | ||
| throw new ParseException("It is not allowed to add catalog/database " + |
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.
namespace here as well
| withTable(t) { | ||
| spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") | ||
|
|
||
| val e1 = intercept[AnalysisException] { |
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.
let's use testV1Command.
imback82
left a comment
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.
LGTM
|
Test build #112569 has finished for PR 26179 at commit
|
|
Test build #112577 has finished for PR 26179 at commit
|
|
thanks, merging to master! |
What changes were proposed in this pull request?
Add CacheTableStatement and make CACHE TABLE go through the same catalog/table resolution framework of v2 commands.
Why are the changes needed?
It's important to make all the commands have the same table resolution behavior, to avoid confusing end-users. e.g.
Does this PR introduce any user-facing change?
yes. When running CACHE TABLE, Spark fails the command if the current catalog is set to a v2 catalog, or the table name specified a v2 catalog.
How was this patch tested?
Unit tests.