GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/17366

    [SPARK-19970][SQL][BRANCH-1.6] Table owner should be USER instead of 
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. For Apache Spark 1.6, it happens only with 
`CREATE TABLE ... AS SELECT` (CTAS) statement.
    
    **BEFORE**
    ```scala
    scala> sql("create table t_ctas as select 1").show
    scala> sql("desc formatted t_ctas").show(false)
    ...
    |Owner:                      |[email protected]                             
            |       |
    ```
    
    **AFTER**
    ```scala
    scala> sql("create table t_ctas as select 1").show
    scala> sql("desc formatted t_ctas").show(false)
    ...
    |Owner:                      |spark                                         
|       |
    ```
    
    ## How was this patch tested?
    
    Manually do `create table` and `desc formatted` because this happens in 
Kerberized clusters.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-19970-BRANCH-1.6

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17366.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17366
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to