feat(c/driver/sqlite): ensure batch rows option can be retrieved - #4645
feat(c/driver/sqlite): ensure batch rows option can be retrieved#4645lidavidm wants to merge 4 commits into
Conversation
| formatted = std::to_string(value); | ||
| string_value = formatted; |
There was a problem hiding this comment.
Are there any locale concerns here (i.e., doubles getting exported as 123,456 instead of 123.456)? to_chars() might be better (although I think there was a thing where some gcc versions don't include it?)
There was a problem hiding this comment.
Good point; let me look into that a bit
There was a problem hiding this comment.
Looks like we need GCC11 as a baseline. I believe that's OK: AlmaLinux etc. can install a newer GCC toolchain, and Ubuntu 22.04 has GCC11.
apache/arrow#14666
https://stackoverflow.com/questions/63963961/what-is-the-correct-way-to-call-stdto-chars
https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017
And for clang, we need clang14 (if I understand this table right)
https://libcxx.llvm.org/Status/Cxx17.html
I believe that's supported since macOS 13, which is already EOL. But conda-forge may complain. The minimum is only macOS 11. We mark our packages as requiring macOS 12 due to Golang. And the next version of Go will also require 13. So maybe this is OK.
There was a problem hiding this comment.
It's a tiny bit of a pain, but you could guard the double translation in a define for older gcc/clang since most of the time to_string() is fine.
The getter existed, but the framework needed to be extended to also allow fetching it as a string, and tests were added. Closes apache#3456. Assisted-by: GPT-5.6 Sol <codex@openai.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses Issue #3456 by extending the C driver framework option getter so that numeric option values (notably SQLite’s adbc.sqlite.query.batch_rows) can be retrieved via the string GetOption API, and adds/updates cross-language tests to validate the behavior.
Changes:
- Extend the driver framework option wrapper to allow retrieving
int64_t/doubleoption values as strings viaGetOption. - Add a C++ SQLite driver test validating
batch_rowscan be read both as int and as string (including “buffer too small” length reporting). - Add Python and R tests covering string/int retrieval for the option and numeric-to-string behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| c/driver/framework/base_driver.h | Extends Option::CGet(char*, ...) to stringify numeric option values. |
| c/driver/sqlite/sqlite_test.cc | Adds a regression test verifying adbc.sqlite.query.batch_rows can be retrieved as string/int across database/connection/statement. |
| python/adbc_driver_sqlite/tests/test_lowlevel.py | Adds assertions that BATCH_ROWS can be retrieved as both string and int from Python. |
| r/adbcdrivermanager/tests/testthat/test-options.R | Updates void-driver option tests to expect numeric options to be retrievable as strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hmm. Indeed, we'll need to bump our macOS requirement to 13.3 and install a new toolchain for AlmaLinux 8. Given Go will force our hand on the macOS side, and the AlmaLinux side shouldn't result in any runtime differences, I think this is ok. Any objections? |
The getter existed, but the framework needed to be extended to also allow fetching it as a string, and tests were added.
Closes #3456.
Assisted-by: GPT-5.6 Sol codex@openai.com