Skip to content

feat(vortex-spatial): add make-line scalar function - #9201

Merged
HarukiMoriarty merged 1 commit into
developfrom
nemo/geo-native-bbox-precheck
Aug 10, 2026
Merged

feat(vortex-spatial): add make-line scalar function#9201
HarukiMoriarty merged 1 commit into
developfrom
nemo/geo-native-bbox-precheck

Conversation

@HarukiMoriarty

@HarukiMoriarty HarukiMoriarty commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale

Vortex native geometry arrays should support constructing two-point LineStrings directly from paired Point columns without an Arrow or WKB round trip.

What changes are included?

  • Add vortex.st.make_line for paired native Point arrays.
  • Promote mixed XY, XYZ, XYM, and XYZM inputs, filling absent ordinates with zero.
  • Propagate CRS metadata, constants, and endpoint nulls.
  • Build native LineString storage directly and add focused tests and CodSpeed benchmarks.

Stack

#9291 (primitive Interleave execution) has merged into develop, so this PR is now standalone: rebased onto develop, it contains only the spatial function.

ST_Length was split into #9290 so each scalar function can also be reviewed independently.

@codspeed-hq

codspeed-hq Bot commented Aug 5, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 4 improved benchmarks
❌ 1 regressed benchmark
✅ 1935 untouched benchmarks
🆕 15 new benchmarks
⏩ 89 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cold_misaligned[(64, 256)] 4.4 ms 5.3 ms -17.42%
Simulation decode_varbin[(1000, 4)] 99.3 µs 60.5 µs +64.15%
Simulation slice_primitive_tight_loop[10000] 502.7 µs 438.2 µs +14.74%
Simulation slice_dict_tight_loop[10000] 837.8 µs 738.6 µs +13.44%
Simulation decompress[u64, (1000, 16)] 72.5 µs 65 µs +11.52%
🆕 Simulation primitive_mixed_constants[random/n2/nonnull] N/A 420.3 µs N/A
🆕 Simulation primitive_mixed_constants[random/n2/null] N/A 428.8 µs N/A
🆕 Simulation primitive_mixed_constants[random/n64/nonnull] N/A 652.3 µs N/A
🆕 Simulation primitive_mixed_constants[random/n64/null] N/A 715.3 µs N/A
🆕 Simulation primitive_mixed_constants[round_robin/n2/nonnull] N/A 359 µs N/A
🆕 Simulation primitive_mixed_constants[round_robin/n2/null] N/A 357 µs N/A
🆕 Simulation primitive[random/n2/nonnull] N/A 537.7 µs N/A
🆕 Simulation primitive[random/n2/null] N/A 544.7 µs N/A
🆕 Simulation primitive[random/n64/nonnull] N/A 869 µs N/A
🆕 Simulation primitive[random/n64/null] N/A 910.3 µs N/A
🆕 Simulation primitive[round_robin/n2/nonnull] N/A 376.7 µs N/A
🆕 Simulation primitive[round_robin/n2/null] N/A 383.4 µs N/A
🆕 Simulation column_x_column N/A 213.4 µs N/A
🆕 Simulation column_x_constant N/A 588.8 µs N/A
🆕 Simulation nullable_columns N/A 235.2 µs N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing nemo/geo-native-bbox-precheck (b9562b7) with develop (e77f520)2

Open in CodSpeed

Footnotes

  1. 89 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.

  2. No successful run was found on develop (9157d6c) during the generation of this report, so e77f520 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from a9ca3bf to 7a91f2d Compare August 5, 2026 18:56
@HarukiMoriarty
HarukiMoriarty changed the base branch from develop to nemo/geo-scalar-execution August 5, 2026 19:13
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 7a91f2d to 351f3be Compare August 5, 2026 19:17
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 351f3be to fe549e1 Compare August 5, 2026 19:33
@connortsui20

Copy link
Copy Markdown
Member

@claude review this PR, and look for potential regressions as well as inconsistencies with other code that is not in this PR

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 72a4ae1 to 4abcde8 Compare August 6, 2026 14:41
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 4abcde8 to 98e2031 Compare August 6, 2026 17:58
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from fbd0853 to 184beec Compare August 7, 2026 13:52
Base automatically changed from nemo/geo-scalar-execution to develop August 7, 2026 14:44
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 184beec to b9875c7 Compare August 7, 2026 14:44
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch 3 times, most recently from 9548a2d to f83d073 Compare August 7, 2026 19:17

@connortsui20 connortsui20 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline, should pull out the interleave perf optimizations out of this PR

@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from f83d073 to 1e028c4 Compare August 7, 2026 19:52
Ok(ConstantArray::new(0.0f64, points.len()).into_array())
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in what cases do you ever run into an "absent ordinate", and is returning 0.0 really ok here? instead of null, for example?

its a bit hard for me to understand why we want this behavior in the create linestring functionality

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“absent ordinate” only occurs with mixed-dimensional inputs. We promote the output dimension to the union of both inputs and fill missing Z/M values with zero, matching DuckDB’s ST_MakeLine behavior.

Null would represent a null coordinate inside an otherwise valid geometry and is not supported by the native LineString coordinate storage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HarukiMoriarty HarukiMoriarty changed the title feat(vortex-geo): add make-line and length scalar functions feat(vortex-spatial): add make-line scalar function Aug 7, 2026

@connortsui20 connortsui20 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok LGTM, but please pull out the interleave optimizations before you merge

@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 1e028c4 to 317771d Compare August 7, 2026 20:04
@HarukiMoriarty
HarukiMoriarty removed the request for review from joseph-isaacs August 7, 2026 20:04
@HarukiMoriarty
HarukiMoriarty changed the base branch from develop to nemo/interleave-primitive-execution August 7, 2026 20:05
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 317771d to 1698f91 Compare August 7, 2026 20:20
Base automatically changed from nemo/interleave-primitive-execution to develop August 10, 2026 16:54
HarukiMoriarty added a commit that referenced this pull request Aug 10, 2026
## Summary

- execute Interleave arrays whose values use primitive dtypes
- gather from canonical primitive buffers while preserving constant
value sources
- share selector length and bounds validation with the Boolean kernel
- cover nullable primitive columns, constants, null constants, and
invalid selectors

## Motivation

Interleave previously only had an execution kernel for Boolean values.
This adds the corresponding primitive kernel as a general vortex-array
capability. Spatial MakeLine uses this support in the separate stacked
PR #9201.

---------

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty
HarukiMoriarty force-pushed the nemo/geo-native-bbox-precheck branch from 1698f91 to b9562b7 Compare August 10, 2026 17:12
@HarukiMoriarty
HarukiMoriarty merged commit c61095f into develop Aug 10, 2026
84 of 86 checks passed
@HarukiMoriarty
HarukiMoriarty deleted the nemo/geo-native-bbox-precheck branch August 10, 2026 17:24
connortsui20 pushed a commit that referenced this pull request Aug 10, 2026
## Rationale

Vortex native LineString arrays should support planar length without an
Arrow, WKB, or row-oriented geo_types conversion.

## What changes are included?

- Add vortex.st.length for native LineString inputs.
- Compute every row directly from flattened coordinate buffers and row
offsets.
- Sum all adjacent segments, supporting empty, one-point, and
arbitrary-length LineStrings.
- Preserve constant results and strict null propagation.
- Add focused correctness tests and CodSpeed benchmarks.

## Split

This was split from #9201. It is standalone on develop; #9201 now
contains only ST_MakeLine and primitive Interleave support.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
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.

2 participants