@@ -1182,7 +1182,7 @@ mod test {
1182
1182
db. register_table_function :: < ArrowVTab > ( "arrow" ) ?;
1183
1183
1184
1184
let rbs: Vec < RecordBatch > = db
1185
- . prepare ( "SELECT value::DECIMAL(38,0) as value FROM read_parquet('./examples/int32_decimal.parquet');" ) ?
1185
+ . prepare ( "SELECT * FROM read_parquet('./examples/int32_decimal.parquet');" ) ?
1186
1186
. query_arrow ( [ ] ) ?
1187
1187
. collect ( ) ;
1188
1188
let param = arrow_recordbatch_to_query_params ( rbs. into_iter ( ) . next ( ) . unwrap ( ) ) ;
@@ -1192,7 +1192,7 @@ mod test {
1192
1192
assert_eq ! ( rb. num_columns( ) , 1 ) ;
1193
1193
let column = rb. column ( 0 ) . as_any ( ) . downcast_ref :: < Decimal128Array > ( ) . unwrap ( ) ;
1194
1194
assert_eq ! ( column. len( ) , 1 ) ;
1195
- assert_eq ! ( column. value( 0 ) , i128 :: from( 300 ) ) ;
1195
+ assert_eq ! ( column. value( 0 ) , i128 :: from( 30000 ) ) ;
1196
1196
Ok ( ( ) )
1197
1197
}
1198
1198
@@ -1620,12 +1620,12 @@ mod test {
1620
1620
1621
1621
// With custom width and scale
1622
1622
let array: PrimitiveArray < arrow:: datatypes:: Decimal128Type > =
1623
- Decimal128Array :: from ( vec ! [ i128 :: from( 12345 ) ] ) . with_data_type ( DataType :: Decimal128 ( 38 , 10 ) ) ;
1623
+ Decimal128Array :: from ( vec ! [ i128 :: from( 12345 ) ] ) . with_data_type ( DataType :: Decimal128 ( 5 , 2 ) ) ;
1624
1624
check_rust_primitive_array_roundtrip ( array. clone ( ) , array) ?;
1625
1625
1626
1626
// With width and zero scale
1627
1627
let array: PrimitiveArray < arrow:: datatypes:: Decimal128Type > =
1628
- Decimal128Array :: from ( vec ! [ i128 :: from( 12345 ) ] ) . with_data_type ( DataType :: Decimal128 ( 38 , 0 ) ) ;
1628
+ Decimal128Array :: from ( vec ! [ i128 :: from( 12345 ) ] ) . with_data_type ( DataType :: Decimal128 ( 5 , 0 ) ) ;
1629
1629
check_rust_primitive_array_roundtrip ( array. clone ( ) , array) ?;
1630
1630
1631
1631
Ok ( ( ) )
0 commit comments