Skip to content

fix(#7899): a TIMESERIES type whose TIMESTAMP column is not declared first reads and round-trips correctly - #8141

Merged
robfrank merged 1 commit into
mainfrom
fix/7899-timeseries-non-first-timestamp-jsonl
Sep 22, 2026
Merged

robfrank merged 1 commit into
mainfrom
fix/7899-timeseries-non-first-timestamp-jsonl

Conversation

@robfrank

@robfrank robfrank commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #7899

An engine row is [timestamp, non-TIMESTAMP columns in schema order...] whatever position the TIMESTAMP column occupies in the declaration: TimeSeriesBucket.readRow writes position 0 from the row's own timestamp slot and then walks the schema skipping that column. Four consumers mapped row position i onto getTsColumns().get(i) instead, which is the same thing only while the TIMESTAMP column is declared first - and #7702 made a later position spellable in CREATE TIMESERIES TYPE. This PR moves all four onto the engine's layout, reusing the projection helper (TimeSeriesGateway.selectedColumns) that PromQLEvaluator and GetPromQLSeriesHandler already got right, so SQL, HTTP, gRPC and the JSONL round trip cannot disagree about what position 0 means.

The invariant

Every consumer of a TimeSeriesEngine row maps position 0 to the TIMESTAMP column and position 1 + k to the k-th non-TIMESTAMP column in schema order, regardless of where the TIMESTAMP column is declared.

Finding ledger

  • 1. JsonlExporterFormat.exportTimeSeries documents "schema-column order, timestamp first" but writes the engine layout - fixed (javadoc only; the bytes were already right)
  • 2. JsonlImporterFormat.loadTimeSeriesSamples reads the sample by the TIMESTAMP column's schema position - fixed
  • 3. FetchFromTimeSeriesStep.next() maps row[i] onto columns.get(i) - fixed
  • 4. (not in the report) TimeSeriesGateway.selectedColumns(columns, null) answered the raw schema, against its own javadoc - fixed, which covers 6 wire call sites at once
  • 5. (not in the report) PostPrometheusReadHandler indexes labels, the series key and the sample value by schema position - fixed
  • 6. (not in the report) aggregation push-down reads MultiColumnAggregationRequest.columnIndex as a row index in the mutable half and a schema index in the sealed half - filed as Aggregation push-down reads MultiColumnAggregationRequest.columnIndex as a row index in the mutable half and a schema index in the sealed half #8140, out of scope here

What changed

File Change
TimeSeriesGateway.selectedColumns the null ("every column") branch now returns timestamp-first row order, as its javadoc already promised. A fast path returns the schema list unchanged - no allocation - when the TIMESTAMP column is already first, which is every type written before #7702
FetchFromTimeSeriesStep takes its column list from that helper instead of getTsColumns(), resolved once per pull, not per row
JsonlImporterFormat.loadTimeSeriesSamples timestamp is sample.get(0); value columns are sample.get(1 + k) in non-timestamp schema order, which is the order appendBatch wants them in. timestampIdx is gone
JsonlExporterFormat.exportTimeSeries javadoc only - it says "engine row" where it used to say "schema-column order"
PostPrometheusReadHandler labels, buildLabelKey and the sample value index by 1 + <non-timestamp ordinal>; findFieldColumnIndex becomes findFieldRowIndex. Also folds two stacked javadoc blocks into the one method that was left

Wire-format compatibility

The exporter emits the engine layout and always did, so no format-version bump: an older export of a timestamp-first type is byte-identical under both readings, and no released build could have written an export of a type whose TIMESTAMP column is not first, because #7702 is unreleased -

$ C=$(git log --oneline origin/main --grep="#7702" -1 --format=%H)
$ git merge-base --is-ancestor "$C" 26.9.1 && echo "IN 26.9.1" || echo "NOT in 26.9.1 (unreleased)"
NOT in 26.9.1 (unreleased)

Completeness

Commands run in this session; a path found by reading and not by a command is not listed as found.

$ grep -rln "getTsColumns()" --include='*.java' . | grep -v "/src/test/"
bindings/python/src/java/com/arcadedb/python/TimeSeriesBatcher.java
engine/.../promql/PromQLEvaluator.java
engine/.../timeseries/TimeSeriesGateway.java
engine/.../sql/executor/FetchFromSchemaTypesStep.java
engine/.../sql/executor/FetchFromTimeSeriesStep.java
engine/.../sql/executor/SaveElementStep.java
engine/.../sql/executor/SelectExecutionPlanner.java
engine/.../schema/LocalTimeSeriesType.java
engine/.../schema/TimeSeriesType.java
integration/.../exporter/format/JsonlExporterFormat.java
integration/.../importer/format/JsonlImporterFormat.java
network/.../remote/RemoteTimeSeriesType.java
server/.../handler/GetGrafanaMetadataHandler.java
server/.../handler/GetPromQLLabelsHandler.java
server/.../handler/GetPromQLLabelValuesHandler.java
server/.../handler/GetPromQLSeriesHandler.java
server/.../handler/PostGrafanaQueryHandler.java
server/.../handler/PostPrometheusReadHandler.java
server/.../handler/PostPrometheusWriteHandler.java

$ grep -rn "selectedColumns(\|columnNames(" --include='*.java' . | grep -v "/src/test/"
server/.../GetTimeSeriesLatestHandler.java:126:   columnNames(columns, null)
server/.../PostGrafanaQueryHandler.java:253:      selectedColumns(columns, columnIndices)
server/.../PostTimeSeriesQueryHandler.java:202:   columnNames(columns, columnIndices)
server/.../GetPromQLSeriesHandler.java:167:       selectedColumns(columns, columnIndices)
grpcw/.../ArcadeDbGrpcService.java:3575:          columnNames(columns, columnIndices)
grpcw/.../ArcadeDbGrpcService.java:3861:          columnNames(columns, null)

$ grep -rn "forEachRow" --include='*.java' . | grep -v "/src/test/"   # row-consuming callers
integration/.../JsonlExporterFormat.java:337
engine/.../promql/PromQLEvaluator.java:290, :349
server/.../GetPromQLSeriesHandler.java (forEachTagCombination, same layout)

Entry-point coverage

Entry point Covered by fix? Covered by a test?
JSONL export -> exportTimeSeries yes (doc; bytes already correct) yes - theSampleArrayIsWrittenInEngineRowOrderTimestampFirst
JSONL restore -> loadTimeSeriesSamples, STRING before ts yes yes - aStringTagDeclaredBeforeTheTimestampRoundTrips
JSONL restore -> loadTimeSeriesSamples, NUMERIC before ts (silent) yes yes - aNumericFieldDeclaredBeforeTheTimestampRoundTripsWithoutSwappingTheTimestamp
SQL SELECT * -> FetchFromTimeSeriesStep yes yes - two tests, STRING and NUMERIC before ts
TimeSeriesGateway.selectedColumns(cols, null) yes yes - theFullRowProjectionListsTheTimestampFirstWhateverTheDeclarationSays (pins the projecting branch too)
POST /ts/{db}/query raw yes, via the helper yes - theQueryEndpointNamesTheColumnsInTheOrderItReturnsTheirValues
GET /ts/{db}/latest yes, via the helper yes - theLatestEndpointNamesTheColumnsInTheOrderItReturnsTheirValues
Grafana POST /ts/{db}/grafana/query raw yes, via the helper yes - theGrafanaFrameNamesEachFieldAfterTheValueItCarries
gRPC TimeSeriesQuery stream yes, via the helper covered by regression (Issue7663GrpcTimeSeriesLimitFetchBoundIT, Issue7390...); no non-first-timestamp test - see residual risk
gRPC TimeSeriesLatest yes, via the helper same as above
Prometheus remote read labels / series key / sample yes yes - thePrometheusRemoteReadLabelsAndSamplesComeFromTheirOwnColumns
Engine row layout itself (TimeSeriesBucket.readRow) n/a - it is the contract yes - theEngineRowItselfCarriesTheTimestampInPositionZero pins it
PromQLEvaluator argued - already maps by role and says so; green in 44 PromQL tests existing
GetPromQLSeriesHandler, GetPromQLLabels* argued - selectedColumns with a NON-null projection (the already-correct branch); collectDistinctTagValues resolves BY NAME existing
SaveElementStep.saveToTimeSeries (write) argued - resolves every column by name, which is why the stored sample was right all along existing
TimeSeriesBatch / python TimeSeriesBatcher (write) argued - kinds is sized over non-TIMESTAMP columns (ObjectColumnsRowSource.kindsOf) and python passes enumerate(column_values), so both already use the non-ts ordinal existing
TagFilter / resolveColumnIndices argued - non-ts ordinals throughout, documented on resolveColumnIndices existing
GetGrafanaMetadataHandler, FetchFromSchemaTypesStep, RemoteTimeSeriesType, DatabaseChecker argued - iterate columns for metadata, never index a row existing
Aggregation push-down (MultiColumnAggregationRequest.columnIndex) no - filed as #8140 no

Residual risk

  1. Aggregation push-down reads MultiColumnAggregationRequest.columnIndex as a row index in the mutable half and a schema index in the sealed half #8140 is real and reproduced, not theoretical. With FIELDS (v DOUBLE) TAGS (host STRING) TIMESTAMP ts and five samples, SELECT ts.timeBucket('1h', ts) AS b, sum(v) FROM A GROUP BY b answers 8.50000001E12 before compactAll() and 15.0 after it - the mutable half reads columnIndex as a row index, the sealed half as a schema index, and all four producers supply the schema index. Fixing it means choosing one convention and moving SelectExecutionPlanner, both HTTP handlers, the gRPC service and TimeSeriesSealedStore onto it, which is a bigger change than this one and would bury it.
  2. The two gRPC time-series RPCs are fixed through the shared helper but have no non-first-timestamp test of their own. They are covered by the helper's own unit test and by 25 existing gRPC time-series IT assertions, all green; a dedicated gRPC case was judged redundant against a one-line shared fix. If that judgement is wrong, it is a missing test and not a missing fix.
  3. Nothing else. The table above has no blank rows.

Adversarial pass

No isolated subagent was available in this environment (Task is not exposed), so the pass was run by me directly against the diff, with each finding checked by a command rather than by recollection.

  • "The exporter should permute to schema order instead, as the issue's first suggestion allows." Rejected with evidence. Permuting on the way out makes every existing export unreadable by the new importer and vice versa, which forces a format-version bump; keeping the engine layout needs none, and the issue itself says so ("the fix can be applied without a format version bump only if the exporter keeps emitting timestamp-first").
  • "A mixed-vintage export could still be misread." Checked, cannot happen: A SQL-rendered TIMESERIES create reorders interleaved TAG and FIELD columns #7702 is not an ancestor of the 26.9.1 tag (command above), so no released build can have exported a type whose TIMESTAMP column is not first, and for every other type the two readings produce identical bytes.
  • "columns.getFirst() on the new fast path throws for a type with no columns." Guarded by !columns.isEmpty(). A type with no TIMESTAMP column at all also still returns the same list it used to, in the same order.
  • "nonTsColumnNames() in the same file has the same bug." Checked, it does not: it skips the TIMESTAMP column and trims with Arrays.copyOf.
  • "The write paths have the mirror bug." Checked all three, they do not: SaveElementStep resolves by name, TimeSeriesBatch.kinds is sized over non-TIMESTAMP columns, python passes positional value columns.
  • Genuinely found and acted on: items 4 and 5 of the ledger (the shared helper and the Prometheus read handler), neither of which is in the issue, and item 6 (Aggregation push-down reads MultiColumnAggregationRequest.columnIndex as a row index in the mutable half and a schema index in the sealed half #8140).

Test plan

  • mvn -o -pl engine test -Dtest=Issue7899NonFirstTimestampRowMappingTest - 4 tests. 3 of 4 fail before the fix ("srv-1" vs 1700000000000L; 7L vs 1700000000000L; ["host","ts","v"] vs ["ts","host","v"]); the 4th pins the engine contract and passes both before and after
  • mvn -o -pl integration test -Dtest=Issue7899JsonlNonFirstTimestampRoundTripTest - 3 tests. Before the fix: one ClassCastException: String cannot be cast to Number out of loadTimeSeriesSamples:603 and one silent expected 1700000000000L but was 7L
  • mvn -o -pl server test -Dtest=Issue7899NonFirstTimestampReadSurfacesTest - 4 tests, all 4 fail before the fix, one per read surface
  • Regression, engine: 234 tests (com.arcadedb.engine.timeseries.**) + 89 (schema/SQL time-series, including Issue7702InterleavedTagAndFieldOrderTest) - green
  • Regression, integration: whole module, 573 tests - green
  • Regression, gRPC: Issue7390..., Issue7663..., Issue7725..., Issue7699... - 25 tests green
  • Regression, server: Issue7663GrafanaPrometheusRowCeilingIT (11), Issue7371PromQLDiscoveryProjectionIT (8), Issue7660... (4), Issue7683... (3) + 25 unit tests - green
  • mvn -o -DskipTests install over the whole reactor - green

Two IT classes are red, and are red on main too. PrometheusRemoteWriteReadIT and TimeSeriesPerTypeAclIT build their URLs as "http://127.0.0.1:248" + serverIndex, and port 2480 was held by two foreign JVMs during this run (lsof -nP -iTCP:2480 -sTCP:LISTEN showed PIDs 41389 and 52771), so the requests reached another server and came back 404/403. Re-run from a detached worktree at origin/main in the same environment: also red, with a different subset of methods failing - the signature of a port collision rather than of a code change. Neither class uses the free-port base accessor; that is the pre-existing gap #7983 was about. The new server test uses getServerHttpPort().

Coverage

Fixed here: the JSONL export/import round trip (both the loud and the silent shape), SELECT *, TimeSeriesGateway.selectedColumns for the full row, and through it GET /ts/{db}/latest, POST /ts/{db}/query, the Grafana raw frame and both gRPC time-series RPCs, plus the Prometheus remote read's labels, series key and sample value.

Known gaps: the aggregation push-down's row-vs-schema index confusion - #8140, reproduced, filed before this PR opened. No other gap.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed time-series queries so timestamps and values remain matched with the correct column names when the timestamp column is not declared first.
    • Corrected JSONL export and import to preserve timestamp-first row ordering.
    • Fixed Prometheus and Grafana read responses to return accurate labels and sample values for these schemas.
    • Updated time-series row ordering consistently across query and HTTP read endpoints.
  • Tests

    • Added coverage for query, export/import, Prometheus, Grafana, and latest-value scenarios.

…first reads and round-trips correctly

An engine row is [timestamp, non-TIMESTAMP columns in schema order...] whatever position the TIMESTAMP
column occupies in the declaration: TimeSeriesBucket.readRow writes position 0 from the row's own timestamp
slot and then walks the schema SKIPPING that column. Four consumers mapped row position i onto
getTsColumns().get(i) instead, which is the same thing only while the TIMESTAMP column is declared first -
and issue #7702 made a later position spellable in CREATE TIMESERIES TYPE.

- TimeSeriesGateway.selectedColumns: the null ("every column") branch answered the raw schema instead of
  the row order its own javadoc promises, so GET /ts/latest, POST /ts/query, the Grafana frames and both
  gRPC time-series RPCs named their response columns after the neighbouring column's values.
- FetchFromTimeSeriesStep: SELECT * answered a TAG's value under the timestamp's name and back.
- JsonlImporterFormat.loadTimeSeriesSamples: took the timestamp from the TIMESTAMP column's SCHEMA
  position, so a restore either died with a bare ClassCastException or silently exchanged the timestamp
  with the numeric column ahead of it.
- PostPrometheusReadHandler: indexed labels, the series key and the sample value by schema position.

JsonlExporterFormat is unchanged on the wire - it emitted the engine layout all along; only its javadoc,
which called that "schema-column order", is corrected. No format-version bump: #7702 is not in any release
(verified with git merge-base --is-ancestor against 26.9.1), so no released build could have written an
export of a type whose TIMESTAMP column is not first, and every older export is byte-identical under both
readings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mergify

mergify Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a440be54-25d3-484f-9664-3c0c1a2756ab

📥 Commits

Reviewing files that changed from the base of the PR and between 9a88be7 and ab0a257.

📒 Files selected for processing (8)
  • engine/src/main/java/com/arcadedb/engine/timeseries/TimeSeriesGateway.java
  • engine/src/main/java/com/arcadedb/query/sql/executor/FetchFromTimeSeriesStep.java
  • engine/src/test/java/com/arcadedb/engine/timeseries/Issue7899NonFirstTimestampRowMappingTest.java
  • integration/src/main/java/com/arcadedb/integration/exporter/format/JsonlExporterFormat.java
  • integration/src/main/java/com/arcadedb/integration/importer/format/JsonlImporterFormat.java
  • integration/src/test/java/com/arcadedb/integration/exporter/Issue7899JsonlNonFirstTimestampRoundTripTest.java
  • server/src/main/java/com/arcadedb/server/http/handler/PostPrometheusReadHandler.java
  • server/src/test/java/com/arcadedb/server/http/handler/Issue7899NonFirstTimestampReadSurfacesTest.java

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change aligns time-series SQL, JSONL, and HTTP read paths with timestamp-first engine row ordering when the TIMESTAMP column is not first in the schema. Regression tests cover row mapping, JSONL round trips, and HTTP read surfaces.

Changes

Time-series row ordering

Layer / File(s) Summary
Engine row mapping
engine/src/main/java/com/arcadedb/engine/timeseries/TimeSeriesGateway.java, engine/src/main/java/com/arcadedb/query/sql/executor/FetchFromTimeSeriesStep.java, engine/src/test/java/com/arcadedb/engine/timeseries/Issue7899NonFirstTimestampRowMappingTest.java
Full-row column selection now returns the timestamp first, followed by non-timestamp columns in schema order. SQL mapping uses this ordering. Regression tests cover tag-first and numeric-field-first schemas.
JSONL engine-row round trip
integration/src/main/java/com/arcadedb/integration/exporter/format/JsonlExporterFormat.java, integration/src/main/java/com/arcadedb/integration/importer/format/JsonlImporterFormat.java, integration/src/test/java/com/arcadedb/integration/exporter/Issue7899JsonlNonFirstTimestampRoundTripTest.java
JSONL import reads the timestamp from position 0 and values from subsequent non-timestamp positions. Tests verify restored rows and the exported sample array.
HTTP read surface mapping
server/src/main/java/com/arcadedb/server/http/handler/PostPrometheusReadHandler.java, server/src/test/java/com/arcadedb/server/http/handler/Issue7899NonFirstTimestampReadSurfacesTest.java
Prometheus labels and samples use non-timestamp row ordinals. Tests cover query, latest, Grafana, and Prometheus responses.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Bug fix · Severity of issue fixed: High

Suggested reviewers: lvca

Merge Risk: ⚪ Minimal · up to ab0a2

The change corrects values and column names for time-series schemas where TIMESTAMP is declared later, while preserving JSONL round trips. The covered regression cases indicate no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for issue #7899 and the affected TIMESERIES behavior. It is specific and related to the primary change.
Description check ✅ Passed The description is comprehensive and relevant. It explains the change, motivation, related issue, implementation details, compatibility impact, test coverage, residual risks, and out-of-scope work. It…
Linked Issues check ✅ Passed The pull request satisfies the coding requirements in [#7899]. JsonlImporterFormat now reads timestamp position 0 and non-TIMESTAMP values from positions 1..n in schema order. Export behavior remain…
Out of Scope Changes check ✅ Passed The reviewed changes stay within [#7899]. Production changes correct timestamp-first row mapping, JSONL import documentation, SQL and shared projections, and Prometheus read indexing. The added tests …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity

Metric Results
Complexity 11

View in Codacy

🟢 Coverage 100.00% diff coverage · -6.19% coverage variation

Metric Results
Coverage variation ✅ -6.19% coverage variation
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (642f431) 187386 155921 83.21%
Head commit (ab0a257) 219944 (+32558) 169402 (+13481) 77.02% (-6.19%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#8141) 36 36 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review

Reviewed the diff against the engine's actual row layout (TimeSeriesBucket.readRow, TimeSeriesSealedStore.query), which confirms the stated invariant: [timestamp, non-TIMESTAMP columns in schema order...] regardless of the TIMESTAMP column's declared position. All four fixes are consistent with that layout and with each other.

Code quality / correctness

  • TimeSeriesGateway.selectedColumns: the new null-branch behavior (walk non-timestamp columns in schema order, timestamp first) matches TimeSeriesBucket.readRow's construction exactly. The columns.getFirst().getRole() == TIMESTAMP fast path is a safe no-op for the common case (returns the same list reference getTsColumns() already returned unconditionally before this change, so no new aliasing risk).
  • FetchFromTimeSeriesStep: switching to TimeSeriesGateway.selectedColumns(tsType.getTsColumns(), null), resolved once per pull rather than per row, is both correct and a small efficiency win.
  • JsonlImporterFormat.loadTimeSeriesSamples: walking columns and using sample.get(valueIdx + 1) for non-timestamp columns while reading sample.get(0) for the timestamp is correct and matches what the exporter actually writes (which was already engine-row order - good catch on that pre-existing doc/code mismatch).
  • PostPrometheusReadHandler: findFieldRowIndex, buildLabelKey, and the inline label-building loop are now internally consistent (1 + nonTsIdx throughout), and the added bounds checks (1 + nonTsIdx < row.length, valueRowIndex < row.length) are cheap, sensible defensive guards against a narrowed/projected row.

Test coverage
Strong. The three new test classes cover the loud failure mode (STRING before TIMESTAMP -> wrong type/ClassCastException) and the silent one (numeric column before TIMESTAMP -> swapped values with no exception) across SQL (SELECT *), the JSONL export/import round trip, and all four HTTP/gRPC-adjacent read surfaces (/ts/query, /ts/latest, Grafana frames, Prometheus remote read). Pinning TimeSeriesBucket's raw row layout in theEngineRowItselfCarriesTheTimestampInPositionZero is a good move - it documents the contract every other test and fix leans on.

Scope
The PR explicitly scopes out issue 8140 (aggregation push-down's row-vs-schema index confusion) with a reproduced repro and a filed issue rather than folding it in here - reasonable, since fixing it touches the SQL planner, both HTTP handlers, the gRPC service, and the sealed store, which would bury this fix.

Minor / non-blocking

  • The "no format-version bump" rationale is repeated verbatim across three files (selectedColumns, JsonlExporterFormat, JsonlImporterFormat) - not a defect, just duplicated prose to keep in sync if the invariant ever changes again.
  • The gRPC time-series RPCs are fixed transitively through the shared selectedColumns/columnNames helper but, as the PR description acknowledges, have no dedicated non-first-timestamp regression test of their own (relying on the helper's unit test plus 25 existing green gRPC ITs). Given the helper is now the single source of truth and is directly pinned, this seems like an acceptable tradeoff rather than a gap worth blocking on.

Security / performance
No concerns. No new allocations added on the hot per-row path (the column list is resolved once per pull/request, not per row), no new external input trusted without validation, no new dependencies.

Overall: a well-scoped, well-tested fix that correctly traces the bug back to a single source-of-truth invariant and fixes all four affected consumers consistently.

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.90%. Comparing base (642f431) to head (ab0a257).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...server/http/handler/PostPrometheusReadHandler.java 85.71% 0 Missing and 3 partials ⚠️
.../arcadedb/engine/timeseries/TimeSeriesGateway.java 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8141      +/-   ##
============================================
+ Coverage     74.88%   74.90%   +0.01%     
- Complexity     2579     2582       +3     
============================================
  Files          2004     2004              
  Lines        187386   187399      +13     
  Branches      39184    39191       +7     
============================================
+ Hits         140320   140367      +47     
+ Misses        31504    31472      -32     
+ Partials      15562    15560       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

A TIMESERIES type whose TIMESTAMP column is not declared first round-trips through JSONL with its values in the wrong columns

1 participant