Comments (6)
Hi! I don't know if helper-c.cpp
matters, struct, union and list types aren't present there either, but It's true that the c-api doesn't expose a way to create decimal types using the standard duckdb_create_logical_type
. The issue is that since decimal types are "parameterized" you'd need a different constructor function that allows you to pass the width and scale, (similar to e.g. duckdb_create_list_type
), but thats definitely something we could look into adding.
We do have a duckdb_create_decimal_type
and a duckdb_create_decimal
function, so adding support for this in the rust api not be that complex.
In the case of 256-width decimals however, thats more of an expected limitation as DuckDB itself doesn't support 256-width decimals internally.
from duckdb-rs.
The vtab module does have some support already: https://docs.rs/duckdb/latest/duckdb/vtab/struct.LogicalType.html#method.decimal
from duckdb-rs.
Even if DuckDB-rs has some typing for Decimal128, I think the core issue is that duckdb_execute_prepared_arrow
(i.e. https://github.com/duckdb/duckdb/blob/5b36f520df72be12f90ae31e6f8ed797a7b78e99/src/main/capi/arrow-c.cpp#L163) uses helper-c.cpp
and if that doesn't support Decimal128, no change to only duckdb-rs will fix it.
I don't have the best understanding of duckdb specifically.
from duckdb-rs.
Where are you seeing that function used in the codepath duckdb-rs uses?
from duckdb-rs.
Running
let schema = Schema::new(vec![Field::new("a", input_array.data_type().clone(), false)]);
let rb = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(input_array.clone())])?;
let mut stmt = db.prepare("select a from arrow(?, ?)")?;
let rb = stmt.query_arrow(param)?
stmt.query_arrow
calls duckdb_execute_prepared_arrow
, via:
Line 107 in a1aa55a
Line 63 in a1aa55a
Line 510 in a1aa55a
duckdb-rs/src/raw_statement.rs
Line 223 in a1aa55a
duckdb-rs/src/raw_statement.rs
Line 227 in a1aa55a
from duckdb-rs.
As mentioned DuckDB doesn't support decimal256 or decimals with negative scale, but I've added support for positive decimal128 conversion here #328
from duckdb-rs.
Related Issues (20)
- Extension Autoloading Error: Failed to Download JSON Extension HOT 4
- `bindgen` CI failing on Windows
- how to cancel a query? HOT 1
- Is there a way to register scalar function in ext?
- crash when reading wrong format excel HOT 2
- Dependency on arrow is dictating release cycle of this crate
- Bundle `icu` extension at compile time
- how to create multiple in memory database? HOT 2
- Example on how to read an ENUM from duckdb HOT 2
- Should `RawStatement` implement `Send` and `Sync`?
- append_row, append fails when there are too many fields
- Assertion `!FileSystem::Get(db).FileExists(GetWALPath())` failed
- Dates are returned as days since epoch HOT 1
- Rust extensions based on Extension C API HOT 13
- error: failed to run custom build command for `libduckdb-sys v0.9.2` HOT 1
- How to use the `column_count` method of Statement? HOT 2
- add default extensions
- Multiple connections & threads from a single process
- Bug in code that reads Enums
- INTERNAL Error: Failed to load metadata pointer (id 36, idx 0, ptr 36) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckdb-rs.