Skip to content

Commit 65a73a3

Browse files
committed
test: cover ln float32 negative input
1 parent 6586aed commit 65a73a3

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

datafusion/sqllogictest/test_files/scalar.slt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,16 +582,22 @@ select ln(0);
582582
-Infinity
583583

584584
# ln with positive column values (round is needed to normalize the outputs of different operating systems)
585-
query R rowsort
586-
select round(ln(a), 5) from signed_integers where a > 0;
585+
query RRR rowsort
586+
select round(ln(a), 5), round(ln(b), 5), round(ln(c), 5) from unsigned_integers;
587587
----
588-
0.69315
589-
1.38629
588+
0 4.60517 6.34036
589+
0.69315 6.90776 4.81218
590+
1.09861 9.21034 6.88551
591+
1.38629 NULL NULL
590592

591593
# ln rejects negative scalar inputs
592594
query error Arrow error: Compute error: Cannot take logarithm of a negative number
593595
select ln((-1.0)::float8);
594596

597+
# ln rejects negative Float32 scalar inputs
598+
query error Arrow error: Compute error: Cannot take logarithm of a negative number
599+
select ln((-1.0)::float4);
600+
595601
# ln rejects negative column inputs
596602
query error Arrow error: Compute error: Cannot take logarithm of a negative number
597603
select round(ln(a), 5) from signed_integers;

0 commit comments

Comments
 (0)