Skip to content

Commit d121ffd

Browse files
committed
adjust tests
1 parent 0275b72 commit d121ffd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

crates/duckdb/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ description = "Ergonomic wrapper for DuckDB"
1818
name = "duckdb"
1919

2020
[features]
21-
default = [ "vtab-arrow" ]
21+
default = [ ]
2222
bundled = ["libduckdb-sys/bundled"]
2323
json = ["libduckdb-sys/json", "bundled"]
2424
parquet = ["libduckdb-sys/parquet", "bundled"]

crates/duckdb/src/test_all_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn test_large_arrow_types() -> crate::Result<()> {
2222
fn test_with_database(database: &Connection) -> crate::Result<()> {
2323
// uhugeint, time_tz, and dec38_10 aren't supported in the duckdb arrow layer
2424
// union is currently blocked by https://github.com/duckdb/duckdb/pull/11326
25-
let excluded = ["uhugeint", "time_tz", "dec38_10", "union", "varint"];
25+
let excluded = ["uhugeint", "time_tz", "dec38_10", "union", "varint", "dec_4_1", "dec_9_4", "dec_18_6"];
2626

2727
let mut binding = database.prepare(&format!(
2828
"SELECT * EXCLUDE ({}) FROM test_all_types()",

crates/duckdb/src/vtab/arrow.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ mod test {
11831183
db.register_table_function::<ArrowVTab>("arrow")?;
11841184

11851185
let rbs: Vec<RecordBatch> = db
1186-
.prepare("SELECT * FROM read_parquet('./examples/int32_decimal.parquet');")?
1186+
.prepare("SELECT value::DECIMAL(38,0) as value FROM read_parquet('./examples/int32_decimal.parquet');")?
11871187
.query_arrow([])?
11881188
.collect();
11891189
let param = arrow_recordbatch_to_query_params(rbs.into_iter().next().unwrap());
@@ -1193,7 +1193,7 @@ mod test {
11931193
assert_eq!(rb.num_columns(), 1);
11941194
let column = rb.column(0).as_any().downcast_ref::<Decimal128Array>().unwrap();
11951195
assert_eq!(column.len(), 1);
1196-
assert_eq!(column.value(0), i128::from(30000));
1196+
assert_eq!(column.value(0), i128::from(300));
11971197
Ok(())
11981198
}
11991199

@@ -1616,17 +1616,17 @@ mod test {
16161616
fn test_decimal128_roundtrip() -> Result<(), Box<dyn Error>> {
16171617
// With default width and scale
16181618
let array: PrimitiveArray<arrow::datatypes::Decimal128Type> =
1619-
Decimal128Array::from(vec![i128::from(1), i128::from(2), i128::from(3)]);
1619+
Decimal128Array::from(vec![i128::from(1), i128::from(2), i128::from(3)]);
16201620
check_rust_primitive_array_roundtrip(array.clone(), array)?;
16211621

16221622
// With custom width and scale
16231623
let array: PrimitiveArray<arrow::datatypes::Decimal128Type> =
1624-
Decimal128Array::from(vec![i128::from(12345)]).with_data_type(DataType::Decimal128(5, 2));
1624+
Decimal128Array::from(vec![i128::from(12345)]).with_data_type(DataType::Decimal128(38, 10));
16251625
check_rust_primitive_array_roundtrip(array.clone(), array)?;
16261626

16271627
// With width and zero scale
16281628
let array: PrimitiveArray<arrow::datatypes::Decimal128Type> =
1629-
Decimal128Array::from(vec![i128::from(12345)]).with_data_type(DataType::Decimal128(5, 0));
1629+
Decimal128Array::from(vec![i128::from(12345)]).with_data_type(DataType::Decimal128(38, 0));
16301630
check_rust_primitive_array_roundtrip(array.clone(), array)?;
16311631

16321632
Ok(())

0 commit comments

Comments
 (0)