Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

In the kerberized hadoop cluster, when Spark creates tables, the owner of tables are filled with PRINCIPAL strings instead of USER names. This is inconsistent with Hive and causes problems when using ROLE in Hive. We had better to fix this.

BEFORE

scala> sql("create table t(a int)").show
scala> sql("desc formatted t").show(false)
...
|Owner:                      |spark@EXAMPLE.COM                                         |       |

AFTER

scala> sql("create table t(a int)").show
scala> sql("desc formatted t").show(false)
...
|Owner:                      |spark                                         |       |

How was this patch tested?

Manually do create table and desc formatted because this happens in Kerberized clusters.

}
hiveTable.setPartCols(partCols.asJava)
hiveTable.setOwner(conf.getUser)
hiveTable.setOwner(state.getAuthenticator().getUserName())
Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Mar 20, 2017

Choose a reason for hiding this comment

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

@vanzin . I made a backport for branch-2.1 of #17311 . This one uses state as you advised.

@SparkQA
Copy link

SparkQA commented Mar 20, 2017

Test build #74891 has finished for PR 17363 at commit 1328f1d.

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

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented Mar 20, 2017

This is also tested manually in kerberized cluster, @vanzin .

BTW, Spark 1.6 has the same issue at ClientWrapper.

According to the Spark dev email, there exists demands on more Apache Spark 1.6.X. May I create a backport for branch-1.6? How do you think about that?

For Spark 1.6, it happens only with CREATE TABLE .. AS SELECT statement.

@dongjoon-hyun
Copy link
Member Author

Hi, @vanzin .
Could you review this backport when you have some time?

@dongjoon-hyun
Copy link
Member Author

Retest this please

@SparkQA
Copy link

SparkQA commented Mar 22, 2017

Test build #75055 has finished for PR 17363 at commit 1328f1d.

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

@vanzin
Copy link
Contributor

vanzin commented Mar 23, 2017

Merging to 2.1 / 2.0.

I don't really expect any more 1.6 releases at this point, so I wouldn't bother.

asfgit pushed a commit that referenced this pull request Mar 23, 2017
…PRINCIPAL in kerberized clusters

## What changes were proposed in this pull request?

In the kerberized hadoop cluster, when Spark creates tables, the owner of tables are filled with PRINCIPAL strings instead of USER names. This is inconsistent with Hive and causes problems when using [ROLE](https://cwiki.apache.org/confluence/display/Hive/SQL+Standard+Based+Hive+Authorization) in Hive. We had better to fix this.

**BEFORE**
```scala
scala> sql("create table t(a int)").show
scala> sql("desc formatted t").show(false)
...
|Owner:                      |sparkEXAMPLE.COM                                         |       |
```

**AFTER**
```scala
scala> sql("create table t(a int)").show
scala> sql("desc formatted t").show(false)
...
|Owner:                      |spark                                         |       |
```

## How was this patch tested?

Manually do `create table` and `desc formatted` because this happens in Kerberized clusters.

Author: Dongjoon Hyun <[email protected]>

Closes #17363 from dongjoon-hyun/SPARK-19970-2.
@vanzin
Copy link
Contributor

vanzin commented Mar 23, 2017

Failed to merge to 2.0. :-/

@vanzin
Copy link
Contributor

vanzin commented Mar 23, 2017

@dongjoon-hyun you'll have to manually close this.

@dongjoon-hyun
Copy link
Member Author

Oo. Thank you so much, @vanzin !

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