Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/22419#discussion_r218534147
--- Diff: sql/core/src/test/resources/sql-tests/inputs/operators.sql ---
@@ -96,3 +96,9 @@ select positive('-1.11'), positive(-1.11),
negative('-1.11'), negative(-1.11);
-- pmod
select pmod(-7, 2), pmod(0, 2), pmod(7, 0), pmod(7, null), pmod(null, 2),
pmod(null, null);
select pmod(cast(3.13 as decimal), cast(0 as decimal)), pmod(cast(2 as
smallint), cast(0 as smallint));
+
+-- truncate
+select truncate(1234567891.1234567891, -4),
truncate(1234567891.1234567891, 0), truncate(1234567891.1234567891, 4);
+select truncate(cast(1234567891.1234567891 as decimal), -4),
truncate(cast(1234567891.1234567891 as decimal), 0),
truncate(cast(1234567891.1234567891 as decimal), 4);
+select truncate(cast(1234567891.1234567891 as long), -4),
truncate(cast(1234567891.1234567891 as long), 0),
truncate(cast(1234567891.1234567891 as long), 4);
+select truncate(cast(1234567891.1234567891 as long), 9.03)
--- End diff --
Could you add a test omitting scale?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]