Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion core/src/main/java/org/apache/iceberg/StatsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,23 @@ private static Types.NestedField upperBoundField(Type type, int baseId) {

@VisibleForTesting
static Types.StructType fieldStatsStruct(Type type, int baseId, MetricsModes.MetricsMode mode) {
if (null == mode || mode == MetricsModes.None.get() || type.isNestedType() || baseId < 0) {
if (null == mode || mode == MetricsModes.None.get() || baseId < 0) {
return null;
}

if (type.isStructType()) {
return Types.StructType.of(
optional(
baseId + VALUE_COUNT_OFFSET,
"value_count",
Types.LongType.get(),
"Number of values (including null)"),
optional(
baseId + NULL_VALUE_COUNT_OFFSET,
"null_value_count",
Types.LongType.get(),
"Number of null values"));
} else if (type.isNestedType()) {
return null;
}

Expand Down
1 change: 1 addition & 0 deletions orc/src/main/java/org/apache/iceberg/orc/OrcMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ public Set<Integer> record(
.filter(Optional::isPresent)
.map(Optional::get)
.forEach(result::add);
ORCSchemaUtil.icebergID(record).ifPresent(result::add);
return result.build();
}
}
Expand Down
Loading