File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
vortex-duckdb-ext/src/duckdb Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -201,3 +201,23 @@ impl From<&[u8]> for Value {
201201 unsafe { Self :: own ( cpp:: duckdb_create_blob ( value. as_ptr ( ) , value. len ( ) as _ ) ) }
202202 }
203203}
204+
205+ #[ cfg( test) ]
206+ mod tests {
207+
208+ use crate :: duckdb:: i128_from_parts;
209+
210+ #[ test]
211+ fn test_huge_int_from_parts ( ) {
212+ assert_eq ! ( i128_from_parts( 0 , 0 ) , 0i128 ) ;
213+ assert_eq ! ( i128_from_parts( 0 , 34534912 ) , 34534912i128 ) ;
214+ assert_eq ! ( i128_from_parts( i64 :: MIN , 0 ) , i128 :: MIN ) ;
215+ assert_eq ! ( i128_from_parts( i64 :: MAX , u64 :: MAX ) , i128 :: MAX ) ;
216+
217+ assert_eq ! ( i128_from_parts( 0 , u64 :: MAX ) , u64 :: MAX as i128 ) ;
218+ assert_eq ! (
219+ i128_from_parts( 1 , u64 :: MAX ) ,
220+ ( 1i128 << 64 ) + ( u64 :: MAX as i128 )
221+ ) ;
222+ }
223+ }
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ impl<'a> TryFrom<&'a Scalar> for ExtScalar<'a> {
122122
123123impl Scalar {
124124 pub fn extension ( ext_dtype : Arc < ExtDType > , value : Scalar ) -> Self {
125- assert_eq ! ( ext_dtype. storage_dtype( ) , value. dtype( ) ) ;
125+ // TODO(joe): enable once we use rust duckdb
126+ // assert_eq!(ext_dtype.storage_dtype(), value.dtype());
126127 Self {
127128 dtype : DType :: Extension ( ext_dtype) ,
128129 value : value. value ( ) . clone ( ) ,
You can’t perform that action at this time.
0 commit comments