@Override
  public List<Partition> getPartitionsByExpr(org.apache.hadoop.hive.ql.metadata.Table hmsTable, ExprNodeDesc filter,
      Boolean latestSpecOnly) throws SemanticException {
    Expression exp = HiveIcebergInputFormat.getFilterExpr(conf, (ExprNodeGenericFuncDesc) filter);
    if (exp == null) {
      return ImmutableList.of();
    }
    Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
    int tableSpecId = table.spec().specId();
    Set<Partition> partitions = Sets.newHashSet();

    TableScan scan = table.newScan().filter(exp)
        .caseSensitive(false).includeColumnStats().ignoreResiduals();

    try (CloseableIterable<FileScanTask> tasks = scan.planFiles()) {
      FluentIterable.from(tasks).filter(task -> task.spec().isPartitioned()).forEach(task -> {
        DataFile file = task.file();
        PartitionSpec spec = task.spec();

        if (latestSpecOnly == null || latestSpecOnly && file.specId() == tableSpecId ||
              !latestSpecOnly && file.specId() != tableSpecId) {

          PartitionData partitionData = IcebergTableUtil.toPartitionData(task.partition(), spec.partitionType());
          String partName = spec.partitionToPath(partitionData);

          Map<String, String> partSpecMap = Maps.newLinkedHashMap();
          Warehouse.makeSpecFromName(partSpecMap, new Path(partName), null);

          DummyPartition partition = new DummyPartition(hmsTable, partName, partSpecMap);
          partitions.add(partition);
        }
      });
    } catch (IOException e) {
      throw new SemanticException(String.format("Error while fetching the partitions due to: %s", e));
    }
    return ImmutableList.copyOf(partitions);
  }
A function to fetch the column information of the underlying column defined by the table format.
@param hmsTable A Hive table instance
@param colName Column name
@return An instance of ColumnInfo.
@throws SemanticException An exception is thrown when the column is not present, or if we unable to fetch
column type due to SerDeException, or if the associated field object inspector is not present.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java