bojana-db commented on code in PR #58242:
URL: https://github.com/apache/spark/pull/58242#discussion_r3956588366


##########
sql/core/src/test/resources/sql-tests/inputs/math.sql:
##########
@@ -148,3 +148,37 @@ SELECT POSITIVE(25.5);
 SELECT POSITIVE("25.5");
 SELECT POSITIVE("invalid");
 SELECT POSITIVE(null);
+
+-- Gcd
+SELECT gcd(24, 36);
+SELECT gcd(17, 5);
+-- The result is never negative, whichever inputs are.

Review Comment:
   ```suggestion
   -- The result is non-negative regardless of the inputs' signs.
   ```



##########
sql/core/src/test/resources/sql-tests/inputs/math.sql:
##########
@@ -148,3 +148,37 @@ SELECT POSITIVE(25.5);
 SELECT POSITIVE("25.5");
 SELECT POSITIVE("invalid");
 SELECT POSITIVE(null);
+
+-- Gcd
+SELECT gcd(24, 36);
+SELECT gcd(17, 5);
+-- The result is never negative, whichever inputs are.
+SELECT gcd(-24, 36);
+SELECT gcd(24, -36);
+SELECT gcd(-24, -36);
+-- Zero is divisible by everything, so it acts as the identity.
+SELECT gcd(0, 0);
+SELECT gcd(0, -7);
+SELECT gcd(7, 0);
+SELECT gcd(null, 5);
+SELECT gcd(5, null);
+
+-- Lcm
+SELECT lcm(4, 6);
+SELECT lcm(17, 5);
+-- The result is never negative, whichever inputs are.

Review Comment:
   ```suggestion
   -- The result is non-negative regardless of the inputs' signs.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to