[ 
https://issues.apache.org/jira/browse/SPARK-22846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300308#comment-16300308
 ] 

Dongjoon Hyun commented on SPARK-22846:
---------------------------------------

Hi, [~xwc3504].

When I used 2.2.1, it works. Could you describe your situation more 
specifically?

{code}
scala> spark.version
res0: String = 2.2.1

scala> sql("CREATE TABLE spark_22846(a INT)")

scala> sql("DESCRIBE FORMATTED spark_22846").show
+--------------------+--------------------+-------+
|            col_name|           data_type|comment|
+--------------------+--------------------+-------+
|                   a|                 int|   null|
|                    |                    |       |
|# Detailed Table ...|                    |       |
|            Database|             default|       |
|               Table|         spark_22846|       |
|               Owner|            dongjoon|       |
{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