Skip to content

Conversation

@gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented Mar 24, 2017

What changes were proposed in this pull request?

This is a follow-up for the PR: #17311

  • For safety, use sessionState to get the user name, instead of calling SessionState.get() in the function toHiveTable.
  • Passing user names instead of conf when calling toHiveTable.

How was this patch tested?

N/A

@gatorsmile
Copy link
Member Author

cc @dongjoon-hyun @vanzin @cloud-fan

@SparkQA
Copy link

SparkQA commented Mar 24, 2017

Test build #75134 has finished for PR 17405 at commit b45ad79.

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


override def createTable(table: CatalogTable, ignoreIfExists: Boolean): Unit = withHiveState {
client.createTable(toHiveTable(table, Some(conf)), ignoreIfExists)
client.createTable(toHiveTable(table), ignoreIfExists)
Copy link
Member

Choose a reason for hiding this comment

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

This has different semantics because it'll always skip setting the owner.

Copy link
Member Author

@gatorsmile gatorsmile Mar 24, 2017

Choose a reason for hiding this comment

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

uh, I forgot to change it back... Thanks for catching it.

/** Returns the configuration for the current session. */
def conf: HiveConf = state.getConf

private val userName = state.getAuthenticator.getUserName
Copy link
Contributor

Choose a reason for hiding this comment

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

is this userName shared by all SparkSessions?

Copy link
Member Author

@gatorsmile gatorsmile Mar 24, 2017

Choose a reason for hiding this comment

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

All the SparkSessions share the same internal Hive SessionState. After we create it, the user name is set, if my understanding is not wrong, no matter which HiveAuthenticationProvider that users choose.

Previously, before merging the PR #17311, do we have the same issue?

cc @vanzin @dongjoon-hyun @yhuai

@SparkQA
Copy link

SparkQA commented Mar 24, 2017

Test build #75142 has finished for PR 17405 at commit 890dc7b.

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

@dongjoon-hyun
Copy link
Member

@gatorsmile . It looks good to me. Thank you for refactoring.

@asfgit asfgit closed this in 344f38b Mar 24, 2017
@cloud-fan
Copy link
Contributor

thanks, merging to master!

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.

5 participants