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

[CARBONDATA-795]rename table is changing provided db to current db #674

Closed
wants to merge 1 commit into from

Conversation

nareshpr
Copy link
Contributor

When user trigger rename table command not on current database, table is getting renamed from provided db to current db.
eg., alter table testdb.test1 rename to testdb.test2
Assume current db is default,
Above query is renaming the table from testdb.test1 to default.test2

@CarbonDataQA
Copy link

Build Failed with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1230/

@nareshpr
Copy link
Contributor Author

retest this please

@CarbonDataQA
Copy link

Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1233/

@@ -174,7 +175,7 @@ private[sql] case class AlterTableRenameTable(alterTableRenameModel: AlterTableR
CarbonEnv.get.carbonMetastore.removeTableFromMetadata(oldDatabaseName, oldTableName)
sparkSession.sharedState.externalCatalog.asInstanceOf[HiveExternalCatalog].client
.runSqlHive(
s"ALTER TABLE $oldDatabaseName.$oldTableName RENAME TO $newTableName")
s"ALTER TABLE $oldDatabaseName.$oldTableName RENAME TO $newDatabaseName.$newTableName")
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this to oldDatabaseName

@CarbonDataQA
Copy link

Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1237/

@nareshpr
Copy link
Contributor Author

retest this please

@CarbonDataQA
Copy link

Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1240/

@nareshpr nareshpr closed this Mar 20, 2017
@nareshpr nareshpr reopened this Mar 20, 2017
@gvramana
Copy link
Contributor

LGTM

@asfgit asfgit closed this in d6d5eca Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants