Skip to content

feat: Reexport the Arrow generics from DBI - #584

Merged
krlmlr merged 3 commits into
mainfrom
claude/arrow
Nov 29, 2026
Merged

krlmlr merged 3 commits into
mainfrom
claude/arrow

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

RMariaDB now supports the DBI Arrow interface (dbGetQueryArrow(), dbSendQueryArrow(), dbFetchArrow(), dbFetchArrowChunk(), dbReadTableArrow(), dbWriteTableArrow(), dbAppendTableArrow(), dbCreateTableArrow(), dbBindArrow()). It does this the same way RSQLite's main does: it reexports DBI's generics, so DBI's default methods, which go through data frames, apply to RMariaDB's classes.

This is the bottom layer. A native implementation following RSQLite's open stack (r-dbi/RSQLite#880) will be proposed separately. It will build on the per-chunk column store from #587.

Changes

Tests

Run locally against MariaDB 10.11 with DBI 1.3.0, DBItest 1.9.0 and nanoarrow 0.9.0, with NOT_CRAN=true.

A clean review found nothing above Low. See the questions and the "Accepted limitations" comment below.

Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ

https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ


Generated by Claude Code

DBI's default methods for `dbGetQueryArrow()` and friends now apply to RMariaDB's classes.
`R/export.R` is generated by the new `tests/testthat/helper-reexport.R`, as in RSQLite,
which also exports `dbGetConnectArgs()`.
The "reexport" DBItest skip is gone,
and the remaining Arrow skips name their cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Question: Where to fix the spurious loss-of-precision warning (#586)

Two timestamp_extended Arrow specs stay skipped (helper-DBItest.R). The reason is that nanoarrow 0.9.0 warns for any int64 value beyond 2^53, even when the conversion to double is exact. DBI's default dbAppendTableArrow() and DBItest's check_arrow() both hit this warning. #586 has the reproducer. Task scope limits issues to r-dbi/RMariaDB, so nothing has been filed upstream yet.

  • Report it upstream in apache/arrow-nanoarrow (warn only when a value changes) and keep the skips until a release fixes it; this costs one issue and no code here (recommended)
  • Suppress that warning in DBI's default dbAppendTableArrow() via a PR in r-dbi/DBI; that fixes it for every backend, but DBItest's own check_arrow() would still warn
  • Leave it to the planned native RMariaDB Arrow path, which wouldn't convert through double; this takes the longest

If nobody decides, the skips stay and #586 remains open.


Generated by Claude Code

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Question: Harden the R/export.R generator?

tests/testthat/helper-reexport.R is RSQLite's generator. In an interactive session with NOT_CRAN set and outside CI, it rewrites R/export.R on every load_all() or devtools::test() and doesn't run roxygen afterwards. NAMESPACE can therefore fall behind until the next devtools::document(). Its output also depends on the locally installed DBI, so a generic added in a future DBI would be exported even if the DESCRIPTION floor lacks it.

  • Keep it as in RSQLite; the same behavior exists there and the diff shows up in git status (recommended)
  • Write only when the content differs, and warn to run devtools::document(); a few lines, which then diverge from RSQLite
  • Move it to a script under tools/ that is run on demand; it would no longer run by accident, but is easily forgotten

If nobody decides, it stays as in RSQLite.


Generated by Claude Code

@krlmlr
krlmlr added this pull request to stack #590 November 29, 2026 11:44

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Accepted limitations


Generated by Claude Code

@krlmlr
krlmlr marked this pull request as ready for review November 29, 2026 11:44
@krlmlr
krlmlr merged commit 9860fe7 into main Nov 29, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/arrow branch November 29, 2026 14:07
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.

2 participants