feat(bindings): splitNspans / splitEachNspans lowercase aliases#8
Merged
nhungoc1508 merged 2 commits intoApr 27, 2026
Merged
Conversation
2 tasks
MEOS's default error handler writes the message to stderr and calls exit(EXIT_FAILURE) on errlevel == ERROR (PG elog level 21 carried through via postgres.h). That tears down the whole DuckDB process on any invalid user input — a parse error on a malformed tstzset literal, a negative precision on asText, etc. — which (a) is user-hostile in production and (b) makes every `statement error` test kill the test runner before Catch2 can check it. PR #6 surfaced this by trying to exercise MEOS error paths in the parity harness and crashing CI on the first parse-error query. This PR installs `MobilityduckMeosErrorHandler` via `meos_initialize_error_handler(...)` in LoadInternal, right after `meos_initialize()`. The handler throws a DuckDB::InvalidInputException on errlevel >= 21 (ERROR/FATAL/PANIC), so MEOS errors surface as ordinary query failures with the MEOS message attached. Lower levels (WARNING/NOTICE/INFO) are silently ignored for now — can be wired to DuckDB's logger in a follow-up if useful. Parity file (`test/sql/parity/001_set.test`) consequences: - Deletes the top-of-file error-handler gap note (now obsolete). - Unwraps the 3 MEOS-error-specific `mode skip` blocks covering tstzset parse errors and asText negative-digits — they run as real `statement error` assertions. - Re-wraps ONE of those (`set('{}'::timestamptz[])`) in a skip block with a new gap note: that query fails at the DuckDB cast layer with a conversion error before MEOS sees it, because `'{}'` is PG array-literal syntax that DuckDB rejects as a string literal. The equivalent DuckDB form `set(ARRAY[]::TIMESTAMPTZ[])` reaches MEOS but the constructor wrapper in src/temporal/set_functions.cpp returns null instead of calling meos_error(...) on empty input — a separate gap, documented for a later follow-up. Verified locally (`TZ=UTC ./build/release/test/unittest "/path/to/test/*"`): 747 assertions pass across 13 test cases (up from 739 pre-handler), no regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 25, 2026
MobilityDB's SQL surface exposes splitNspans and splitEachNspans (lowercase "spans"). MobilityDuck registered only the camelCase forms splitNSpans / splitEachNSpans in src/temporal/span.cpp, so queries using the MobilityDB-native name errored with "function not found". Adds the lowercase aliases for all five set types (intset/bigintset/floatset/dateset/tstzset), pointing at the same SpanFunctions::Set_split_n_spans / SpanFunctions::Set_split_each_n_spans dispatchers. The camelCase forms stay registered for back-compat. Activates the splitNspans / splitEachNspans queries in test/sql/parity/001_set.test.
52feed7 to
cdea92e
Compare
This was referenced Apr 25, 2026
Member
Author
|
@nhungoc1508 — flagging a merge-target issue. This PR is marked MERGED, but the merge commit went into the stack-base branch, not
Net effect: this PR's contents never reached Re-landed in #44, which brings both commits forward as a clean linear history on top of For future stacked PRs: when a base PR (e.g. #7) is merged into main, the dependent PRs (#8, #9) should have their base updated to |
estebanzimanyi
added a commit
that referenced
this pull request
May 10, 2026
…policy - Adds `doc/contributing/reviewer-guide.md` — single source of truth for reviewing open PRs. Canonical structure shared with MobilityDB (PR #931) and MobilitySpark (PR #8): How to find this guide → CI legend (5 symbols incl.⚠️ ) → Dependency chains → Tier 1/2/3 → Review checklist. - Wires visibility for reviewers landing on the repo: - `.github/PULL_REQUEST_TEMPLATE.md` — banner appears in every new PR. - `README.md` — "For contributors and reviewers" section, links to the reviewer guide; mentions canonical cross-repo structure. - Establishes the rule: every PR commit that changes queue state (opens/closes PR, discovers a dependency) updates the guide in the same commit. Once this lands and companion PRs land on MobilityDB/MobilitySpark, anyone landing in any of the three platform repos finds the same canonical guide at the same path with consistent visibility through the README and the PR template.
estebanzimanyi
added a commit
that referenced
this pull request
May 10, 2026
…policy - Adds `doc/contributing/reviewer-guide.md` — single source of truth for reviewing open PRs. Canonical structure shared with MobilityDB (PR #931) and MobilitySpark (PR #8): How to find this guide → CI legend (5 symbols incl.⚠️ ) → Dependency chains → Tier 1/2/3 → Review checklist. - Wires visibility for reviewers landing on the repo: - `.github/PULL_REQUEST_TEMPLATE.md` — banner appears in every new PR. - `README.md` — "For contributors and reviewers" section, links to the reviewer guide; mentions canonical cross-repo structure. - Establishes the rule: every PR commit that changes queue state (opens/closes PR, discovers a dependency) updates the guide in the same commit. Once this lands and companion PRs land on MobilityDB/MobilitySpark, anyone landing in any of the three platform repos finds the same canonical guide at the same path with consistent visibility through the README and the PR template.
estebanzimanyi
added a commit
that referenced
this pull request
May 26, 2026
…policy - Adds `doc/contributing/reviewer-guide.md` — single source of truth for reviewing open PRs. Canonical structure shared with MobilityDB (PR #931) and MobilitySpark (PR #8): How to find this guide → CI legend (5 symbols incl.⚠️ ) → Dependency chains → Tier 1/2/3 → Review checklist. - Wires visibility for reviewers landing on the repo: - `.github/PULL_REQUEST_TEMPLATE.md` — banner appears in every new PR. - `README.md` — "For contributors and reviewers" section, links to the reviewer guide; mentions canonical cross-repo structure. - Establishes the rule: every PR commit that changes queue state (opens/closes PR, discovers a dependency) updates the guide in the same commit. Once this lands and companion PRs land on MobilityDB/MobilitySpark, anyone landing in any of the three platform repos finds the same canonical guide at the same path with consistent visibility through the README and the PR template.
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
MobilityDB's SQL surface exposes
splitNspansandsplitEachNspans(lowercase "spans"). MobilityDuck registered only the camelCase formssplitNSpans/splitEachNSpansinsrc/temporal/span.cpp, so every parity query using the MobilityDB-native name errored out with "function not found". This PR adds the lowercase aliases for all five set types (intset/bigintset/floatset/dateset/tstzset), pointing at the same underlyingSpanFunctions::Set_split_n_spans/SpanFunctions::Set_split_each_n_spansdispatchers. The camelCase forms stay registered for back-compat with existing MobilityDuck callers.Parity file
Unwraps the splitN/splitEach skip block — 15 queries now active, including the 2
statement error-1cases that work thanks to the MEOS error handler installed in the parent PR this branch stacks on.Test plan
TZ=UTC ./build/release/test/unittest "<proj>/test/*"locally: 747 assertions pass across 13 test cases, no regressions.Dependencies
Stacked on #7 (
fix: install MEOS error handler). This PR's base branch isfix/meos-error-handler, notmain— the 2statement errorcases inside the unwrapped block need the error handler from #7 to not kill the test runner. Merge order: #7 → this.🤖 Generated with Claude Code