Skip to content

Commit 160aa65

Browse files
committed
correction for rebased iceberg view commit recently merged to master
Change-Id: Ie3440239248870fb44c6e956d5be10271b28a1a0
1 parent 73cef9a commit 160aa65

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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();

ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)