Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22846

table's owner property in hive metastore is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.2.1
    • 2.3.0
    • SQL
    • None
    • spark 2.2.1, hive 0.14, hadoop 2.6.0

    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:

      private val userName = state.getAuthenticator.getUserName
      

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

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

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

      Attachments

        1. talbe_owner_null.png
          74 kB
          bruce xu

        Activity

          People

            xwc3504 bruce xu
            xwc3504 bruce xu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: