@@ -395,7 +395,7 @@ NaN NaN
395395
396396# abs: return type
397397query TT rowsort
398- SELECT arrow_typeof(c1), arrow_typeof(c2 ) FROM test_nullable_float limit 1
398+ SELECT arrow_typeof(abs( c1)) , arrow_typeof(abs(c2) ) FROM test_nullable_float limit 1
399399----
400400Float32 Float64
401401
@@ -466,34 +466,48 @@ drop table test_non_nullable_float
466466
467467statement ok
468468CREATE TABLE test_nullable_decimal(
469- c1 DECIMAL(10, 2),
470- c2 DECIMAL(38, 10)
471- ) AS VALUES (0, 0), (NULL, NULL);
472-
473- query RR
469+ c1 DECIMAL(10, 2), /* Decimal128 */
470+ c2 DECIMAL(38, 10), /* Decimal128 with max precision */
471+ c3 DECIMAL(40, 2), /* Decimal256 */
472+ c4 DECIMAL(76, 10) /* Decimal256 with max precision */
473+ ) AS VALUES
474+ (0, 0, 0, 0),
475+ (NULL, NULL, NULL, NULL);
476+
477+ query RRRR
474478INSERT into test_nullable_decimal values
475- (-99999999.99, '-9999999999999999999999999999.9999999999'),
476- (99999999.99, '9999999999999999999999999999.9999999999');
479+ (
480+ -99999999.99,
481+ '-9999999999999999999999999999.9999999999',
482+ '-99999999999999999999999999999999999999.99',
483+ '-999999999999999999999999999999999999999999999999999999999999999999.9999999999'
484+ ),
485+ (
486+ 99999999.99,
487+ '9999999999999999999999999999.9999999999',
488+ '99999999999999999999999999999999999999.99',
489+ '999999999999999999999999999999999999999999999999999999999999999999.9999999999'
490+ )
477491----
4784922
479493
480494
481- query R rowsort
495+ query R
482496SELECT c1*0 FROM test_nullable_decimal WHERE c1 IS NULL;
483497----
484498NULL
485499
486- query R rowsort
500+ query R
487501SELECT c1/0 FROM test_nullable_decimal WHERE c1 IS NULL;
488502----
489503NULL
490504
491- query R rowsort
505+ query R
492506SELECT c1%0 FROM test_nullable_decimal WHERE c1 IS NULL;
493507----
494508NULL
495509
496- query R rowsort
510+ query R
497511SELECT c1*0 FROM test_nullable_decimal WHERE c1 IS NOT NULL;
498512----
4995130
@@ -507,19 +521,24 @@ query error DataFusion error: Arrow error: Divide by zero error
507521SELECT c1%0 FROM test_nullable_decimal WHERE c1 IS NOT NULL;
508522
509523# abs: return type
510- query TT rowsort
511- SELECT arrow_typeof(c1), arrow_typeof(c2) FROM test_nullable_decimal limit 1
524+ query TTTT
525+ SELECT
526+ arrow_typeof(abs(c1)),
527+ arrow_typeof(abs(c2)),
528+ arrow_typeof(abs(c3)),
529+ arrow_typeof(abs(c4))
530+ FROM test_nullable_decimal limit 1
512531----
513- Decimal128(10, 2) Decimal128(38, 10)
532+ Decimal128(10, 2) Decimal128(38, 10) Decimal256(40, 2) Decimal256(76, 10)
514533
515- # abs: Decimal128
516- query RR rowsort
517- SELECT abs(c1), abs(c2) FROM test_nullable_decimal
534+ # abs: decimals
535+ query RRRR rowsort
536+ SELECT abs(c1), abs(c2), abs(c3), abs(c4) FROM test_nullable_decimal
518537----
519- 0 0
520- 99999999.99 9999999999999999999999999999.9999999999
521- 99999999.99 9999999999999999999999999999.9999999999
522- NULL NULL
538+ 0 0 0 0
539+ 99999999.99 9999999999999999999999999999.9999999999 99999999999999999999999999999999999999.99 999999999999999999999999999999999999999999999999999999999999999999.9999999999
540+ 99999999.99 9999999999999999999999999999.9999999999 99999999999999999999999999999999999999.99 999999999999999999999999999999999999999999999999999999999999999999.9999999999
541+ NULL NULL NULL NULL
523542
524543statement ok
525544drop table test_nullable_decimal
0 commit comments