File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
sql/hive/src/main/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -717,10 +717,19 @@ private[hive] case class MetastoreRelation
717717 }
718718
719719 // Must be a stable value since new attributes are born here.
720- val partitionKeys = hiveQlTable.getPartitionKeys.map(_.toAttribute)
721-
720+ // Since we create the TTable inside hiveQlTable manually, we can use TTbale's interface
721+ // to get Partition keys at here. We do this to make sure Hive will not try to use
722+ // any metastore utility functions. All of interactions between metastore and related
723+ // parts should be done through our ClientWrapper.
724+ /** PartitionKey attributes */
725+ val partitionKeys = hiveQlTable.getTTable.getPartitionKeys.map(_.toAttribute)
726+
727+ // Since we create the TTable inside hiveQlTable manually, we can use TTbale's interface
728+ // to get non-partition columns at here. We do this to make sure Hive will not try to use
729+ // any metastore utility functions. All of interactions between metastore and related
730+ // parts should be done through our ClientWrapper.
722731 /** Non-partitionKey attributes */
723- val attributes = hiveQlTable.getCols.map(_.toAttribute)
732+ val attributes = hiveQlTable.getTTable.getSd. getCols.map(_.toAttribute)
724733
725734 val output = attributes ++ partitionKeys
726735
You can’t perform that action at this time.
0 commit comments