Repository navigation
feat(core): set-operation leg schemas decided before any row; a denied GET / falls back to the build major - #423
Merged
Conversation
…d GET / falls back to the build major (SCHEMA-0) Story SCHEMA-0: set-operation leg schemas are decided up front. - `SetOperationValues.legSchemas` gives, per leg and column, the type at every depth and a reader answering that type's class, before any row is read. A date whose mapping format core cannot read for every value (zone names, region ids, unmeasured letters, Elasticsearch 6.8's AM/PM with no hour) is VARCHAR as stored, for every row; every other date keeps its type. - No slot (values typed as they come) where the leg's or the column's type is not known at some depth, for a NULL or `SELECT *` leg, and for NUMERIC, TEMPORAL, VARBINARY and REAL legs. - `VersionApi.dateDialectVersion`: the cluster's version, else, for a user denied `GET /`, the major the client module is built for; asked once per client. Core's UNION ALL reads dates through it too. - The existing readers (`legReaders`, `converters`, `positionConverter`) are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fupelaqu
marked this pull request as ready for review
October 14, 2026 15:13
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.
Summary
Set-operation legs get their column schemas before any row is read, so a consumer can type each leg up front instead of from its first rows.
SetOperationValues.legSchemasgives, per leg and column, the type at every depth (struct fields, list elements) and a reader that answers that type's class.VARCHAR, the text as stored, for every row. That covers zone names, region ids, unmeasured letters, and Elasticsearch 6.8's AM/PM with no hour.legReadersreads it.ANY, a struct with no known fields);NULLorSELECT *;NUMERIC,TEMPORAL,VARBINARYorREAL.VersionApi.dateDialectVersion: the cluster's version, else the major the client module is built for, for a user whose role is deniedGET /.ElasticClientDelegator.UNION ALLreads dates through it too: one code line inSearchApi.setOperationVersion.converter,readAs,dateByFormat,positionConverter,legReader,legReaders,converters). The diff adds only, apart from that one line and three comments.Behaviour changes (release notes)
GET /:UNION ALLnow reads dates as the client's build major. Before, a converting date failed ("… which is not known"). Example:SELECT d AS k FROM t UNION ALL SELECT c_c1 AS k FROM t, withc_c1formattedyyyy/MM/dd, now answers2024-01-31T00:00Z.VersionApigains a member (a lazy val). Projects that implementVersionApimust be rebuilt.Evidence
DateRouteSpec,SetOperationLegSchemasSpec,DateDialectVersionSpec,LegSchemasConsumerSmokeSpeclegReaders/converters/columnTreeoutputs,mainvs branchGET /asked once per client throughMetricsElasticClientcore/test(clone of the commit)+ compile(2.12 + 2.13) and lint (headerCheck scalafmtSbtCheck scalafmtCheck test:scalafmtCheck) on the commit; the 5 client modules (es9 on JDK 17) andcheckLog4jon the first implementation (no dependency changed since)SetOperationTypeSpec+UnionAllCompletenessSpecSetOperationTypeSpec+UnionAllCompletenessSpecPerformance
main7094067 vs this branch, runs interleaved (main, branch, main, branch).d ∪ c_c1+n ∪ x;ts ∪ ts;tsz ∪ ts.main(run 1, run 2)UNION ALLrow loop, ns/row: convertinglegReadersread, ns/value: converting / agreeing / zone-nameunionAllRowMappersbuild, µs: converting / agreeing / zone-namelegSchemasbuild, µs (new; only its callers pay it)legSchemasslot read, ns/valuesetOperationVersionchanged.legSchemas. Parse and resolve cost 130–420 µs for the same statements.Not in this PR
legSchemasin a follow-up change, after this one is released.legReadersfails every object at a struct field typedANY.legSchemasgives no slot there.🤖 Generated with Claude Code