/** * get iceberg partition map. * * @param icebergTable iceberg table * @param filter iceberg filter expression * @return scan summary map */ public Map<String, ScanSummary.PartitionMetrics> getPartitionMetricsMap(final Table icebergTable, @Nullable final Expression filter) { return (filter != null) ? ScanSummary.of(icebergTable.newScan().filter(filter)) .limit(connectorContext.getConfig().getMaxPartitionsThreshold()) .throwIfLimited() .build() : ScanSummary.of(icebergTable.newScan()) //the top x records .limit(connectorContext.getConfig().getIcebergTableSummaryFetchSize()) .build(); } }
/** * get iceberg partition map. * * @param icebergTable iceberg table * @param filter iceberg filter expression * @return scan summary map */ public Map<String, ScanSummary.PartitionMetrics> getPartitionMetricsMap(final Table icebergTable, @Nullable final Expression filter) { return (filter != null) ? ScanSummary.of(icebergTable.newScan().filter(filter)) .limit(connectorContext.getConfig().getMaxPartitionsThreshold()) .throwIfLimited() .build() : ScanSummary.of(icebergTable.newScan()) //the top x records .limit(connectorContext.getConfig().getIcebergTableSummaryFetchSize()) .build(); } }