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
[SPARK-7943] [SPARK-8105] [SPARK-8435] [SPARK-8714] [SPARK-8561] Fixes multi-database support #7623
Conversation
Test build #38244 has finished for PR 7623 at commit
|
|
||
case _ => | ||
val cmd = | ||
CreateTableUsingAsSelect( |
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.
Should refactor CreateTableUsingAsSelect
to use TableIdentifier
.
Test build #38246 has finished for PR 7623 at commit
|
table(new SqlParser().parseTableIdentifier(tableName)) | ||
} | ||
|
||
private[sql] def table(tableIdent: TableIdentifier): DataFrame = { |
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.
Is this called frequently enough to justify a function? It would be great to remove this if possible, since this API is also accessible in Java, and Java users won't see this as a private API.
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.
It's called right above... I can make it private
instead of private[sql]
though.
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.
I saw the call above. Why having this if it is only used once?
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.
To provide better support for multiple databases, internally we should always use TableIdentifier
instead of String
or Seq[String]
. That's why I made this private[sql]
.
c49cb5c
to
ec5f903
Compare
Test build #38460 has finished for PR 7623 at commit
|
Test build #38459 has finished for PR 7623 at commit
|
ec5f903
to
f3bcd4b
Compare
Test build #38527 has finished for PR 7623 at commit
|
Merging to master. |
This PR fixes a set of issues related to multi-database. A new data structure
TableIdentifier
is introduced to identify a table among multiple databases. We should stop using a singleString
(table name without database name), orSeq[String]
(optional database name plus table name) to identify tables internally.