Skip to content

JVM columnar readers return the values the row readers do - #180

Merged
tae898 merged 1 commit into
mainfrom
fix/jvm-columnar-values
Nov 1, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/jvm-columnar-values

Conversation

@tae898

@tae898 tae898 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #178

JVM build only (the native readers already return these values).

  • src/java/com/arcadedb/python/ColumnBatcher.java: nextColumnBatch returns {buffer, side}; a json column (nested list or map values) is written with TypedRows' tagged encoding, so dates, datetimes, Decimals and int map keys keep their type; values JSON cannot carry go to the side array. A new micros form writes datetime columns as epoch microseconds for to_dataframe. TypedRows.append is package-private for this.
  • src/arcadedb/results.py: to_dataframe reads through _read_columns(..., micros=True) (datetime64[us], dates as datetime.date); to_columns and to_arrow keep their documented milliseconds; json columns decode with the same _typed_hook as to_list; an empty float32 vector reads as empty instead of KeyError: 'dim'.
  • src/arcadedb/type_conversion.py: a subnormal double in a bulk row sends that row down the per-row path, so 5e-324 stays a float.
  • Tests: tests/test_columnar_readers.py (C2, B3 through to_columns/to_dataframe and to_arrow, B2, A4, plus a guard that to_columns/to_arrow keep milliseconds).

Verification: against the 26.11.1.dev0 wheels of main the JVM wheel fails the new tests (33) and the native wheel passes the whole file (67). Java is compiled and the fixed JVM wheel is tested by this PR's CI. #179 (NaN and inf on the JVM readers) touches the same json-column path and is rebased on this one after it merges.

🤖 Generated with Claude Code

to_dataframe keeps microseconds and dates (C2): ColumnBatcher takes a micros flag and writes datetime columns as epoch microseconds, DATE and tz-aware columns as tagged JSON; to_columns and to_arrow keep their documented milliseconds. A json column is written with TypedRows' tagged encoding plus a side array of engine objects, so a date, datetime, Decimal or int map key inside a list or map reads as to_list() reads it (B3). An empty float vector has no dim in the header and reads as empty (B2). insert_many refuses a subnormal double for the bulk JSON path, whose parser read 5e-324 as a BigDecimal (A4). Java is not compiled here; CI builds it.

Against the main 26.11.1.dev0 wheels the JVM wheel fails the new tests (33 failed) and the native wheel passes the whole file (67 passed). The Java change is compiled and tested by CI.

Closes #178

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit e5cd316 into main Nov 1, 2026
36 checks passed
@tae898
tae898 deleted the fix/jvm-columnar-values branch November 1, 2026 13:17
tae898 added a commit that referenced this pull request Nov 1, 2026
#180 writes nested list/map values of the columnar readers with the
TypedRows tagged encoding and decodes them with _typed_hook, the path
to_list() uses, which keeps NaN and the infinities; its version of the
json column (ColumnBatcher and results.py) is kept, and this branch's
keepNonFinite/_loads_nonfinite now cover to_json_list and
iter_json_batches (RowBatcher). tests/test_nonfinite_floats.py still
checks every reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898 added a commit that referenced this pull request Nov 1, 2026
…#183)

#180 sends a bulk JSON chunk through a per-row Python walk when its text
contains "e-3", to catch a subnormal double the engine's parser would
read as a BigDecimal. "e-3" is common in ordinary text (hex ids, UUIDs,
"name-3"), so such loads walked every chunk. The text is now searched
for the exponent json.dumps writes for a subnormal (e-308 to e-329 after
a digit) with a compiled pattern: the same C-speed scan, no false hits on
ordinary text. Test: UUID-like and "name-3" text never reaches the walk;
5e-324 and the largest subnormal still raise ValueError (per-row path).

Closes #182

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

JVM columnar readers: to_dataframe drops microseconds; nested dates, Decimals and int keys decoded from JSON; empty vector KeyError

1 participant