Details
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);