Repository navigation
fix(core): an un-aliased dotted column carries its value in core's rows - #425
Merged
Merged
Conversation
…ws (SCHEMA-12) Story SCHEMA-12. Reviewed: r0:clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(SCHEMA-12) Review follow-up, text only: the user-docs bullet states when the parent object is still returned, and three comments drop a premise the story's measurements disproved (an INSERT ... SELECT never writes a null cell). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fupelaqu
marked this pull request as ready for review
October 17, 2026 06: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
SELECT obj.a FROM tnow returns the value ofobj.aunder the nameobj.aon every row core builds, asSELECT obj.a AS k FROM talready did underk. The parent objectobjis no longer added as an extra column once its fields have been read.One implementation in core: the row reader for a projection's un-aliased dotted columns is planned once per stream (or per response) from the projection, and every row route goes through it — plain search (sync and async), scroll / PIT / search_after (sequential, sliced, sorted),
_msearch,UNION ALLlegs, and theWHERE … IN (SELECT …)subquery. Statements without an un-aliased dotted column keep main's row function itself (a unit test checks the reference identity), so they do no new work per row.Closes #424
Behaviour changes (release notes)
{obj.a = 4}where main answered{obj.a = null, obj = {a = 4}}). A document holding a flat"obj.a": nullbeside the nestedobj.areads the nested value, as Elasticsearch does in its doc values. A ranking window orders by that value, and a window partitioned by such a column finds its partition.obj) no longer appears as an extra column through JDBC, the REPL and arrow plain queries, once its fields have been read. A row still carries it when theSELECTlist names it, contains*, reads another field of it under an alias, or when it holds values the dotted name cannot read on its own (an array of objects, a flat"obj.a"key with a value).n IN (SELECT obj.a FROM t LIMIT 100)reads every document's value.Unchanged: aliased columns, plain fields, computed columns, aggregations and typed-entity reads (
searchAs) return main's rows byte for byte;INSERT … SELECTwrites main's documents (so materialized-view changelogs are unchanged); no type change; no case-class arity change (no downstream rebuild).Evidence
core/test1,259 / 1,259.NestedPathColumnsSpec15 / 15, which failed 8 / 8 on main's code (every route answerednulland leakedobj).JavaClientDottedColumnSpec11 / 11 (with consumer smokes on arrow's, the JDBC driver's and extensions' read paths),JavaClient8ReplGatewayIntegrationSpec79 / 79,JavaClientInsertByQuerySpec8 / 8.INSERTorsearchAsline moved.NestedPathCostProbe, 31 × 1,000, main and branch interleaved twice): warm means s1 −1.2 %, s2 +0.7 %, s3 +0.3 %, within run-to-run noise.+ compile(2.12 and 2.13) green; the CI lint line passes on a clone of the committed bytes. Elasticsearch 6.8, 7.17 and 9.0 run in CI.Recorded, not fixed (pre-existing or out of scope)
obj.a AS kstill answersNULLfor a document holding a flat"obj.a": nullbeside the nested value (its lookup is unchanged).UNNESTreads a deeper inner path (c.addr.city) asNULL;top_hits-based aggregates (ARRAY_AGG,FIRST_VALUEoverobj.a) miss nested-shaped values.SELECT id, a AS z, obj.a) leavesobj.aNULL, as on main.obj.awhenobj.ais not selected reads base rows that never requested it; the window fallback without fields builds rows without a projection.profile.followers * 2keeps it,t.profile.followers * 2drops it); no value is lost either way.After merge
Core 0.24.0-SNAPSHOT republish: softclient4es-arrow's set-operation work (#198) waits for it.
🤖 Generated with Claude Code