Skip to content
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][SQL]support DataFrame created by hiveContext can create table to specific database by saveAstable(dbname.tablename) #6868

Closed
wants to merge 1 commit into from

Conversation

baishuo
Copy link
Contributor

@baishuo baishuo commented Jun 18, 2015

support hivecontext.sql(....).saveAsTable(dbname.tablename)

@SparkQA
Copy link

SparkQA commented Jun 18, 2015

Test build #35089 has finished for PR 6868 at commit 8937597.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@baishuo baishuo changed the title [SPARK-7943][SQL]support DataFrame created by hiveContext can create table to specific database by saveAstable [SPARK-7943][SQL]support DataFrame created by hiveContext can create table to specific database by saveAstable(dbname.tablename) Jun 18, 2015
@baishuo
Copy link
Contributor Author

baishuo commented Jun 23, 2015

Hi @marmbrus @yhuai ,would you please help me check whether this patch can be merged? :)

@marmbrus
Copy link
Contributor

This would be a nice feature to have and thanks for working on it, but I think we need a more holistic solution than what is proposed here (there are a lot of problems with multiple databases: https://issues.apache.org/jira/browse/SPARK-8131). In particular, this issue duplicates the code that resolves a full database name into several places. Big features should probably start with a design instead of a PR.

}

protected[hive] def invalidateTable(tableName: String): Unit = {
catalog.invalidateTable(catalog.client.currentDatabase, tableName)
val dbAndTableName = tableName.split("\\.")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notice repeated code.
IMHO relative/fully-prefixed tableName logic should be extracted into something like cannonicalTableName(relativeOrPrefixedTableName)

@marmbrus
Copy link
Contributor

marmbrus commented Aug 3, 2015

I believe this is fixed now and we can close this issue.

@asfgit asfgit closed this in 804a012 Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants