We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running the following code:
use duckdb::arrow::datatypes::IntervalMonthDayNanoType; use duckdb::{params, Connection}; use duckdb::arrow::array as arrow_array; fn main() -> Result<(), Box<dyn std::error::Error>> { let conn = Connection::open_in_memory()?; let mut stmt = conn.prepare("SELECT '1 year 5 days 12 mins 13 seconds 8 microseconds'::INTERVAL")?; let arrow: duckdb::Arrow = stmt.query_arrow(params![])?; let vec_record_batch = arrow.collect::<Vec<_>>(); println!("{:?}", vec_record_batch); let interval = vec_record_batch[0].column(0).as_any().downcast_ref::<arrow_array::IntervalMonthDayNanoArray>().unwrap().value(0); let (months, days, nanos) = IntervalMonthDayNanoType::to_parts(interval); println!("interval: {:?}", interval); println!("months: {}, days: {}, nanos: {}", months, days, nanos); Ok(()) }
I'm getting this output:
[ RecordBatch { schema: Schema { fields: [ Field { name: "CAST('1 year 5 days 12 mins 13 seconds 8 microseconds' AS INTERVAL)", data_type: Interval(MonthDayNano), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } ], metadata: {} }, columns: [ PrimitiveArray<Interval(MonthDayNano)> [ 13521463553603053924225887764492, ] ], row_count: 1 }] interval: 13521463553603053924225887764492 months: 170, days: -1439399616, nanos: 21474836492
I'm using IntervalMonthDayNanoType::to_parts(interval) from arrow to decode the value so my guess is that the value is not properly encoded.
IntervalMonthDayNanoType::to_parts(interval)
Note
rustc 1.75.0 (82e1608df 2023-12-21) duckdb = "0.10.2"
The text was updated successfully, but these errors were encountered:
This was actually an issue in arrow-rs: duckdb/duckdb-wasm#1696
And was fixed in apache/arrow-rs#5654
It should be resolved in the next release
Sorry, something went wrong.
Tested successfully on the following platforms after upgrade to duckdb = "1.0.0".
duckdb = "1.0.0"
platform: - linux-x64 - macos-arm64 - macos-x64 - windows-x64
No branches or pull requests
Running the following code:
I'm getting this output:
I'm using
IntervalMonthDayNanoType::to_parts(interval)
from arrow to decode the value so my guess is that the value is not properly encoded.Note
rustc 1.75.0 (82e1608df 2023-12-21)
duckdb = "0.10.2"
The text was updated successfully, but these errors were encountered: