Anurag-S1ngh commented on code in PR #19282:
URL: https://github.com/apache/iceberg/pull/19282#discussion_r4811315086
##########
core/src/main/java/org/apache/iceberg/BaseIncrementalAppendScan.java:
##########
@@ -85,7 +85,8 @@ private CloseableIterable<FileScanTask>
appendFilesFromSnapshots(List<Snapshot>
.schemasById(schemas())
.specsById(table().specs())
.ignoreDeleted()
- .columnsToKeepStats(columnsToKeepStats());
+ .columnsToKeepStats(columnsToKeepStats())
+ .scanMetrics(scanMetrics());
Review Comment:
Incremented `totalDataManifests` in both incremental scans before building
the `ManifestGroup`. Added `testScanMetricsCountSkippedManifests`, which uses a
manifest-skipping filter and asserts `total == scanned + skipped`.
##########
core/src/main/java/org/apache/iceberg/BaseIncrementalScan.java:
##########
@@ -123,7 +146,33 @@ public CloseableIterable<T> planFiles() {
true /* from snapshot ID inclusive */));
}
- return doPlanFiles(fromSnapshotIdExclusive, toSnapshotIdInclusive);
+ List<Integer> projectedFieldIds =
Lists.newArrayList(TypeUtil.getProjectedIds(schema()));
+ List<String> projectedFieldNames =
+
projectedFieldIds.stream().map(schema()::findColumnName).collect(Collectors.toList());
+
+ Timer.Timed planningDuration =
scanMetrics().totalPlanningDuration().start();
+
+ return CloseableIterable.whenComplete(
+ doPlanFiles(fromSnapshotIdExclusive, toSnapshotIdInclusive),
+ () -> {
+ planningDuration.stop();
+ Map<String, String> metadata = Maps.newHashMap(context().options());
+ metadata.putAll(EnvironmentContext.get());
+ ScanReport scanReport =
+ ImmutableScanReport.builder()
+ .schemaId(schema().schemaId())
+ .projectedFieldIds(projectedFieldIds)
+ .projectedFieldNames(projectedFieldNames)
+ .tableName(table().name())
+ .snapshotId(toSnapshotIdInclusive)
+ .filter(
+ ExpressionUtil.sanitize(
+ schema().asStruct(), filter(),
context().caseSensitive()))
+
.scanMetrics(ScanMetricsResult.fromScanMetrics(scanMetrics()))
+ .metadata(metadata)
+ .build();
+ context().metricsReporter().report(scanReport);
Review Comment:
Forwarded the table reporter in `BaseTable.newIncrementalChangelogScan()`.
Added `testScanReportsToTableReporter`, which only configures the table
reporter before planning the changelog scan.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]