Source:
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { HiveTableHandle handle = (HiveTableHandle) tableHandle; HivePartitionResult hivePartitionResult; if (handle.getAnalyzePartitionValues().isPresent()) { verify(constraint.getSummary().isAll(), "There shouldn't be any constraint for ANALYZE operation"); hivePartitionResult = partitionManager.getPartitions(metastore, tableHandle, handle.getAnalyzePartitionValues().get(), session); } else { hivePartitionResult = partitionManager.getPartitions(metastore, tableHandle, constraint, session); } Map<String, HiveColumnHandle> predicateColumns = hivePartitionResult.getEffectivePredicate().getDomains().get().keySet().stream() .map(HiveColumnHandle.class::cast) .collect(toImmutableMap(HiveColumnHandle::getName, Functions.identity())); Optional<HiveBucketHandle> hiveBucketHandle = hivePartitionResult.getBucketHandle(); int virtualBucketCount = getVirtualBucketCount(session); if (!hivePartitionResult.getBucketHandle().isPresent() && virtualBucketCount > 0) { hiveBucketHandle = Optional.of(createVirtualBucketHandle(virtualBucketCount)); } TupleDomain<Subfield> domainPredicate = hivePartitionResult.getEffectivePredicate().transform(HiveMetadata::toSubfield); return ImmutableList.of(new ConnectorTableLayoutResult( getTableLayout( session, new HiveTableLayoutHandle( handle.getSchemaTableName(), hivePartitionResult.getPartitionColumns(), pruneColumnComments(hivePartitionResult.getDataColumns()), hivePartitionResult.getTableParameters(), hivePartitionResult.getPartitions(), domainPredicate, TRUE_CONSTANT, predicateColumns, hivePartitionResult.getEnforcedConstraint(), hiveBucketHandle, hivePartitionResult.getBucketFilter(), createTableLayoutString(session, handle.getSchemaTableName(), hivePartitionResult.getBucketHandle(), TRUE_CONSTANT, domainPredicate), isPushdownFilterSupported(session, tableHandle))), hivePartitionResult.getUnenforcedConstraint())); }

Target:
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { HiveTableHandle handle = (HiveTableHandle) tableHandle; HivePartitionResult hivePartitionResult; if (handle.getAnalyzePartitionValues().isPresent()) { verify(constraint.getSummary().isAll(), "There shouldn't be any constraint for ANALYZE operation"); hivePartitionResult = partitionManager.getPartitions(metastore, tableHandle, handle.getAnalyzePartitionValues().get(), session); } else { hivePartitionResult = partitionManager.getPartitions(metastore, tableHandle, constraint, session); } Map<String, HiveColumnHandle> predicateColumns = hivePartitionResult.getEffectivePredicate().getDomains().get().keySet().stream() .map(HiveColumnHandle.class::cast) .collect(toImmutableMap(HiveColumnHandle::getName, Functions.identity())); Optional<HiveBucketHandle> hiveBucketHandle = hivePartitionResult.getBucketHandle(); int virtualBucketCount = getVirtualBucketCount(session); if (!hivePartitionResult.getBucketHandle().isPresent() && virtualBucketCount > 0) { hiveBucketHandle = Optional.of(createVirtualBucketHandle(virtualBucketCount)); } TupleDomain<Subfield> domainPredicate = hivePartitionResult.getEffectivePredicate().transform(HiveMetadata::toSubfield); return ImmutableList.of(new ConnectorTableLayoutResult( getTableLayout( session, new HiveTableLayoutHandle( handle.getSchemaTableName(), hivePartitionResult.getPartitionColumns(), pruneColumnComments(hivePartitionResult.getDataColumns()), hivePartitionResult.getTableParameters(), hivePartitionResult.getPartitions(), domainPredicate, TRUE_CONSTANT, predicateColumns, hivePartitionResult.getEnforcedConstraint(), hiveBucketHandle, hivePartitionResult.getBucketFilter(), false, createTableLayoutString(session, handle.getSchemaTableName(), hivePartitionResult.getBucketHandle(), TRUE_CONSTANT, domainPredicate))), hivePartitionResult.getUnenforcedConstraint())); }