Skip to content

Add more scalar literal types to the Python and JNI bindings - #10079

Merged
robert3005 merged 1 commit into
developfrom
claude/sleepy-tesla-7juwu4
Oct 9, 2026
Merged

robert3005 merged 1 commit into
developfrom
claude/sleepy-tesla-7juwu4

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

Python (vx.scalar and anything that accepts an expression):

  • datetime.time as vortex.time, datetime.date as vortex.date and datetime.datetime as vortex.timestamp, taking the unit (and timezone) from a dtype hint and defaulting to microseconds (days for dates). Timezone-aware values store the UTC instant and take their zone name from zoneinfo.ZoneInfo, pytz or datetime.timezone.utc; pandas.Timestamp nanoseconds are kept for nanosecond timestamps.
  • decimal.Decimal, inferring precision and scale or rescaling exactly to a decimal dtype hint.
  • uuid.UUID as vortex.uuid.
  • Conversions that would lose precision raise ValueError instead of truncating.
  • Fix list and dict values with a list/struct dtype hint: the list was never returned, and struct fields were not cast to the field dtypes, which panicked. Both now cast each element/field to its dtype.
  • Document vx.scalar.

JNI (dev.vortex.api.Expression):

  • literalTime/nullLiteralTime and literalGeometry (WKB decoded into the native spatial extension type).
  • literalU8/U16/U32/U64, literalF16, and U8-U64 and F16 null literals.
  • literalList, literalFixedSizeList, literalStruct and literalMap (plus null variants), assembled from literal expressions with a type prototype literal for element, key and value dtypes.
  • Expression.spatial(SpatialFunction, ...) for area, collect, contains, convex hull, distance, envelope, intersects, length and make-line, with the function codes pinned by the tag parity test.

part of #9913

@robert3005 robert3005 added the changelog/feature A new feature label Sep 26, 2026
Python (`vx.scalar` and anything that accepts an expression):
- `datetime.time` as `vortex.time`, `datetime.date` as `vortex.date` and
  `datetime.datetime` as `vortex.timestamp`, taking the unit (and timezone)
  from a dtype hint and defaulting to microseconds (days for dates).
  Timezone-aware values store the UTC instant and take their zone name from
  `zoneinfo.ZoneInfo`, pytz or `datetime.timezone.utc`; pandas.Timestamp
  nanoseconds are kept for nanosecond timestamps.
- `decimal.Decimal`, inferring precision and scale or rescaling exactly to
  a decimal dtype hint.
- `uuid.UUID` as `vortex.uuid`.
- Conversions that would lose precision raise ValueError instead of
  truncating.
- Fix list and dict values with a list/struct dtype hint: the list was never
  returned, and struct fields were not cast to the field dtypes, which
  panicked. Both now cast each element/field to its dtype.
- Document `vx.scalar`.

JNI (`dev.vortex.api.Expression`):
- `literalTime`/`nullLiteralTime` and `literalGeometry` (WKB decoded into the
  native spatial extension type).
- `literalU8/U16/U32/U64`, `literalF16`, and U8-U64 and F16 null literals.
- `literalList`, `literalFixedSizeList`, `literalStruct` and `literalMap`
  (plus null variants), assembled from literal expressions with a type
  prototype literal for element, key and value dtypes.
- `Expression.spatial(SpatialFunction, ...)` for area, collect, contains,
  convex hull, distance, envelope, intersects, length and make-line, with
  the function codes pinned by the tag parity test.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012A8yJW1z27J5b5N5TW2QMe
@robert3005
robert3005 force-pushed the claude/sleepy-tesla-7juwu4 branch from e4b8d80 to bbc829f Compare October 9, 2026 13:29
@codspeed

codspeed Bot commented Oct 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.25%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ 1 benchmark measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. This result is not comparable, so it counts as unchanged.

Preventing compiler optimizations

⚡ 1 improved benchmark
✅ 2176 untouched benchmarks
⏩ 409 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ WallTime scalar_subtract_neon 12.1 µs 11 µs +10.25%
⚠️ Simulation bench_compare_primitive[(10000, 2)] < 1 ns < 1 ns N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/sleepy-tesla-7juwu4 (bbc829f) with develop (0ff1d1a)

Open in CodSpeed

Footnotes

  1. 409 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@robert3005
robert3005 merged commit c901cf7 into develop Oct 9, 2026
90 checks passed
@robert3005
robert3005 deleted the claude/sleepy-tesla-7juwu4 branch October 9, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants