Skip to content

Commit

Permalink
Ensure statistics predicate only for base column in delta connector
Browse files Browse the repository at this point in the history
tableHandle.getNonPartitionConstraint() can include the dereferenced field
if dereference field is used as a predicate. Since stats for dereferenced field
is not supported, so filter those fields before creating statistics predicate.
  • Loading branch information
krvikash authored and ebyhr committed May 15, 2023
1 parent f2b1cfc commit db43ee8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public TableStatistics getTableStatistics(ConnectorSession session, DeltaLakeTab
}

Set<String> predicatedColumnNames = tableHandle.getNonPartitionConstraint().getDomains().orElseThrow().keySet().stream()
// TODO Statistics for column inside complex type is not collected (https://github.com/trinodb/trino/issues/17164)
.filter(DeltaLakeColumnHandle::isBaseColumn)
.map(DeltaLakeColumnHandle::getBaseColumnName)
.collect(toImmutableSet());
List<DeltaLakeColumnMetadata> predicatedColumns = columnMetadata.stream()
Expand Down

0 comments on commit db43ee8

Please sign in to comment.