Skip to content

Conversation

@xubo245
Copy link
Contributor

@xubo245 xubo245 commented Jan 13, 2018

What changes were proposed in this pull request?

Finish TODO work in alter table set location.
org.apache.spark.sql.execution.command.DDLSuite#testSetLocation

// TODO(gatorsmile): fix the bug in alter table set location.
//    if (isUsingHiveMetastore) {
//    assert(storageFormat.properties.get("path") === expected)
//   }

fix it by remove newPath = None in org.apache.spark.sql.hive.HiveExternalCatalog#restoreDataSourceTable

How was this patch tested?

test("SPARK-23039: check path after SET LOCATION")

Wait for #20249

  TOBO work: Fix the bug in alter table set location.
  org.apache.spark.sql.execution.command.DDLSuite#testSetLocation

    // TODO(gatorsmile): fix the bug in alter table set location.
    //    if (isUsingHiveMetastore) {
    //    assert(storageFormat.properties.get("path") === expected)
    //   }
@xubo245
Copy link
Contributor Author

xubo245 commented Jan 13, 2018

@gatorsmile Please review it. This is your TODO work. Please check it.

@gatorsmile
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Jan 13, 2018

Test build #86103 has finished for PR 20260 at commit 76c1813.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@xubo245
Copy link
Contributor Author

xubo245 commented Jan 19, 2018

I will fix the error of this PR after #20249 (comment) merged

@tgravescs
Copy link
Contributor

@xubo245 please close this if the other PR supersedes.

@xubo245
Copy link
Contributor Author

xubo245 commented Apr 6, 2018

This PR is different

@gatorsmile
Copy link
Member

cc @gengliangwang

val tableLocation = getLocationFromStorageProps(table)
// We pass None as `newPath` here, to remove the path option in storage properties.
updateLocationInStorageProps(table, newPath = None).copy(
table.storage.copy(
Copy link
Member

Choose a reason for hiding this comment

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

In the comments above:

    // Internally we store the table location in storage properties with key "path" for data
    // source tables. Here we set the table location to `locationUri` field and filter out the
    // path option in storage properties, to avoid exposing this concept externally.
// We pass None as `newPath` here, to remove the path option in storage properties.

The property path is removed intentionally.
To finish to a TODO comment in unit test is not a good reason to keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we should remove the TODO comment/work?

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@gengliangwang
Copy link
Member

The TODO in comment should be removed, as I explained.
We should close this PR.

@xubo245 xubo245 closed this Jun 12, 2018
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.

6 participants