Skip to content

Commit

Permalink
Change parameter name in statistics collection metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
pajaks authored and ebyhr committed Aug 21, 2023
1 parent 016748e commit 6e2d23c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ public ConnectorAnalyzeMetadata getStatisticsCollectionMetadata(ConnectorSession
TableStatisticsMetadata statisticsMetadata = getStatisticsCollectionMetadata(
columnsMetadata.stream().map(DeltaLakeColumnMetadata::getColumnMetadata).collect(toImmutableList()),
analyzeColumnNames.orElse(allColumnNames),
true);
false);

return new ConnectorAnalyzeMetadata(newHandle, statisticsMetadata);
}
Expand All @@ -2877,14 +2877,13 @@ public TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(Connector
return getStatisticsCollectionMetadata(
tableMetadata.getColumns(),
analyzeColumnNames.orElse(allColumnNames),
// File modified time does not need to be collected as a statistics because it gets derived directly from files being written
false);
true);
}

private TableStatisticsMetadata getStatisticsCollectionMetadata(
List<ColumnMetadata> tableColumns,
Set<String> analyzeColumnNames,
boolean includeMaxFileModifiedTime)
boolean isCollectionOnWrite)
{
ImmutableSet.Builder<ColumnStatisticMetadata> columnStatistics = ImmutableSet.builder();
tableColumns.stream()
Expand All @@ -2897,8 +2896,9 @@ private TableStatisticsMetadata getStatisticsCollectionMetadata(
columnStatistics.add(new ColumnStatisticMetadata(columnMetadata.getName(), NUMBER_OF_DISTINCT_VALUES_SUMMARY));
});

if (includeMaxFileModifiedTime) {
if (!isCollectionOnWrite) {
// collect max(file modification time) for sake of incremental ANALYZE
// File modified time does not need to be collected as a statistics because it gets derived directly from files being written
columnStatistics.add(new ColumnStatisticMetadata(FILE_MODIFIED_TIME_COLUMN_NAME, MAX_VALUE));
}

Expand Down

0 comments on commit 6e2d23c

Please sign in to comment.