cloud-fan commented on code in PR #39747:
URL: https://github.com/apache/spark/pull/39747#discussion_r1090383764
##########
sql/core/src/test/resources/sql-tests/inputs/string-functions.sql:
##########
@@ -231,3 +231,42 @@ CREATE TEMPORARY VIEW fmtTable(fmtField) AS SELECT * FROM
VALUES ('invalidFormat
SELECT to_binary('abc', fmtField) FROM fmtTable;
-- Clean up
DROP VIEW IF EXISTS fmtTable;
+-- luhn_check
+select luhn_check('4111111111111111');
+select luhn_check('4111111111111111 ');
+select luhn_check('5500000000000004');
+select luhn_check('340000000000009');
+select luhn_check('6011000000000004');
Review Comment:
Ideally the more tests the better, but we should also think about coverage.
The test cases I can think of
1. a few basic cases
2. spaces in the beginning/middle/end
3. non-digits
4. empty string
5. null
6. non string (test implicit cast)
Let's add comments before each test(s) to mention which case it targets. And
we don't need so many basic test cases.
--
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]