[ 
https://issues.apache.org/jira/browse/SPARK-22846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

bruce xu updated SPARK-22846:
-----------------------------
    Description: 
I met this issue after upgrading from spark 2.0.1 to spark 2.2.1.

when creating table using spark sql or spark thriftserver, it occured that the 
table's owner info in metastore is null, which may cause other issue on table 
authentication. It may be a bug.

After digging into the code, I found that in class HiveClientImpl:

{code:java}
private val userName = state.getAuthenticator.getUserName
{code}

the result of state.getAuthenticator.getUserName is null, which would cause all 
operation on tables have a null username, such as method toHiveTable:

{code:java}
 def toHiveTable(table: CatalogTable, userName: Option[String] = None): 
HiveTable = {
{code}

my create table command:  create table  datapm.test_xwc9(id string,name string);





  was:
I met this issue after upgrading from spark 2.0.1 to spark 2.2.1.

when creating table using spark sql or spark thriftserver, it occured that the 
table's owner info in metastore is null, which may cause other issue on table 
authentication. It may be a bug.

After digging into the code, I found that in class HiveClientImpl:

{code:java}
private val userName = state.getAuthenticator.getUserName
{code}

the result of state.getAuthenticator.getUserName is null, which would cause all 
operation on tables have a null username, such as:

{code:java}
 def toHiveTable(table: CatalogTable, userName: Option[String] = None): 
HiveTable = {
{code}





> table's owner property in hive metastore is null
> ------------------------------------------------
>
>                 Key: SPARK-22846
>                 URL: https://issues.apache.org/jira/browse/SPARK-22846
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.1
>         Environment: spark 2.2.1, hive 0.14, hadoop 2.6.0
>            Reporter: bruce xu
>            Priority: Critical
>         Attachments: talbe_owner_null.png
>
>
> I met this issue after upgrading from spark 2.0.1 to spark 2.2.1.
> when creating table using spark sql or spark thriftserver, it occured that 
> the table's owner info in metastore is null, which may cause other issue on 
> table authentication. It may be a bug.
> After digging into the code, I found that in class HiveClientImpl:
> {code:java}
> private val userName = state.getAuthenticator.getUserName
> {code}
> the result of state.getAuthenticator.getUserName is null, which would cause 
> all operation on tables have a null username, such as method toHiveTable:
> {code:java}
>  def toHiveTable(table: CatalogTable, userName: Option[String] = None): 
> HiveTable = {
> {code}
> my create table command:  create table  datapm.test_xwc9(id string,name 
> string);



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to