Skip to content

feat(rest): serialize scan metrics requests - #3766

Draft
DerGut wants to merge 2 commits into
apache:mainfrom
DerGut:rest-scan-report-serialization
Draft

DerGut wants to merge 2 commits into
apache:mainfrom
DerGut:rest-scan-report-serialization

Conversation

@DerGut

@DerGut DerGut commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Works toward #1466. Depends on #3709; the serialization changes are separate from the reporter API commit.

What changes are included in this PR?

REST reporters need an Iceberg-compatible JSON request from the format-neutral reports introduced in #3709. The REST catalog crate owns the crate-private ReportMetricsRequest and its From<&ScanReport> conversion and Serialize implementation. The adapter is internal to the REST reporter, all wire-format helpers are private to that crate, and the core crate is unchanged from #3709. There is no dependency on #3732 or #3736.

The format follows the REST specification. Metric names use Java's constants, including total-file-size-in-bytes and total-delete-file-size-in-bytes; the spec permits arbitrary metric names, while its examples use shorter names. Predicates use the spec-supported term/value representation emitted by Java. Unfiltered scans encode filter: true, and empty metadata is omitted.

HTTP delivery, catalog registration, and predicate sanitization remain follow-ups. Filter literals are serialized as supplied; signed-int64 overflow and non-finite or out-of-range temporal literals return serialization errors.

Are these changes tested?

All 110 REST crate unit tests pass, including nine serialization tests covering the complete request, predicate operators, primitive literal representations, empty fields, and numeric/temporal boundaries. Formatting and Clippy pass. The golden REST request validates against the pinned OpenAPI ReportMetricsRequest schema.

AI Disclosure

AI assisted implementation and validation. Review should focus on conversion through the report getters, predicate wire compatibility, and the rejection policy for numeric overflow and non-finite literals. Tests construct REST request values because #3709's report types have no public constructors; scan-production and HTTP integration remain untested by this prototype.

Expose the reporter contract and read-only scan report types independently
from scan metric collection and delivery.
@DerGut DerGut changed the title feat(metrics): serialize scan reports for REST feat(rest): serialize scan metrics requests Nov 24, 2026
@DerGut
DerGut force-pushed the rest-scan-report-serialization branch 2 times, most recently from b747d3a to 9ece629 Compare November 24, 2026 11:00
@DerGut
DerGut force-pushed the rest-scan-report-serialization branch from 9ece629 to 10a84bb Compare November 24, 2026 14:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant