File tree Expand file tree Collapse file tree
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive
ql/src/java/org/apache/hadoop/hive/ql/metadata Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2148,8 +2148,7 @@ public List<Partition> getPartitions(org.apache.hadoop.hive.ql.metadata.Table hm
21482148
21492149 public boolean isPartitioned (org .apache .hadoop .hive .ql .metadata .Table hmsTable ) {
21502150 if (BaseHiveIcebergMetaHook .isIcebergView (hmsTable .getTTable ())) {
2151- List <FieldSchema > partCols = hmsTable .getPartCols ();
2152- return partCols != null && !partCols .isEmpty ();
2151+ return !hmsTable .getPartitionKeys ().isEmpty ();
21532152 }
21542153 if (hmsTable .getMetaTable () != null || !hmsTable .getTTable ().isSetId ()) {
21552154 return false ;
@@ -2297,8 +2296,7 @@ public boolean canPerformMetadataDelete(org.apache.hadoop.hive.ql.metadata.Table
22972296 @ Override
22982297 public List <FieldSchema > getPartitionKeys (org .apache .hadoop .hive .ql .metadata .Table hmsTable ) {
22992298 if (BaseHiveIcebergMetaHook .isIcebergView (hmsTable .getTTable ())) {
2300- List <FieldSchema > partCols = hmsTable .getPartCols ();
2301- return partCols != null ? partCols : Collections .emptyList ();
2299+ return hmsTable .getPartitionKeys ();
23022300 }
23032301 if (hmsTable .getMetaTable () != null || !hmsTable .getTTable ().isSetId ()) {
23042302 return Collections .emptyList ();
Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ private void ensureColumnsIndexed() {
766766 }
767767 Map <String , TableColumn > indexedColumns = new HashMap <>();
768768 List <FieldSchema > fsList = new ArrayList <>(getColsInternal (false ));
769- if (!hasNonNativePartitionSupport ()) {
769+ if (!hasNonNativePartitionSupport () || isView () ) {
770770 fsList .addAll (getPartitionKeys ());
771771 }
772772 for (int i = 0 ; i < fsList .size (); i ++) {
@@ -837,7 +837,7 @@ private List<FieldSchema> getColsInternal(boolean forMs) {
837837 */
838838 public List <FieldSchema > getAllCols () {
839839 List <FieldSchema > fsList = new ArrayList <>(getColsInternal (false ));
840- if (!hasNonNativePartitionSupport ()) {
840+ if (!hasNonNativePartitionSupport () || isView () ) {
841841 fsList .addAll (getPartitionKeys ());
842842 }
843843 return fsList ;
You can’t perform that action at this time.
0 commit comments