Core: add labels to the load table/view read path - #18045
Open
laskoviymishka wants to merge 1 commit into
Open
laskoviymishka wants to merge 1 commit into
laskoviymishka wants to merge 1 commit into
Conversation
This was referenced Sep 10, 2026
laskoviymishka
added this pull request to stack #18051
September 10, 2026 14:46
This was referenced Sep 10, 2026
nastra
reviewed
Sep 11, 2026
nastra
reviewed
Sep 11, 2026
nastra
reviewed
Sep 11, 2026
nastra
reviewed
Sep 11, 2026
nastra
reviewed
Sep 11, 2026
Reference client implementation for the IRC labels read-path spec change (#15750). Without it, RESTObjectMapper (which sets FAIL_ON_UNKNOWN_PROPERTIES = false) silently drops the labels field on deserialization, so labels returned by a catalog are invisible to the Java client. New rest.labels package (mirroring rest.credentials): Labels (object + fields sub-scopes, with a shared empty instance) and FieldLabels (per-field, keyed by field-id) value types as immutables interfaces, each with a JSON parser. FieldLabels validates field-id >= 1 and a non-empty labels map, matching Credential. Wire an optional labels field into LoadTableResponse / LoadViewResponse and their parsers. labels() never returns null (empty instance when absent), on LoadViewResponse via a @Value.Default default method so no interface API break is introduced. Labels are omitted from the wire when absent (or empty), so the change is additive and backward compatible.
laskoviymishka
force-pushed
the
laskoviymishka/labels-serde
branch
from
September 14, 2026 15:31
98d20c7 to
4cf923b
Compare
nastra
reviewed
Sep 15, 2026
| return JsonUtil.generate(gen -> toJson(fieldLabels, gen), pretty); | ||
| } | ||
|
|
||
| public static void toJson(FieldLabel fieldLabels, JsonGenerator gen) throws IOException { |
Contributor
There was a problem hiding this comment.
nit: fieldLabels -> fieldLabel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of a 5-PR stack implementing the client/engine side of catalog labels. The REST spec was merged in #15750.
This PR adds the Java model and REST serde for the
labelsfield returned on the load-table and load-view responses:LabelsandFieldLabelimmutable value typesLabelsParser/FieldLabelParser(wire keysobject-labels,fields,field-id)labelsintoLoadTableResponse/LoadViewResponseand their parsers, alongside the existingremote-signing-configNote: the Java type is
FieldLabel(singular) while the OpenAPI schema staysFieldLabels— an intentional Java-vs-spec divergence sofieldLabel.labels()reads cleanly. The wire contract (field-id,fields,labels) is unchanged.Stack (linear; each based on the previous)
SupportsLabels)Restructures the earlier cross-fork PRs (#17337 / #17410 / #17411) into a reviewable native stack; those remain open for now.