kosiew commented on code in PR #27158:
URL: https://github.com/apache/datafusion/pull/27158#discussion_r4524422815
##########
datafusion/sqllogictest/test_files/spark/url/parse_url.slt:
##########
@@ -330,9 +330,30 @@ NULL
statement error 'parse_url' does not support zero arguments
SELECT parse_url();
+# A malformed URL returns NULL when ANSI mode is off (the default)
+query T
+SELECT parse_url('inva lid://spark.apache.org/path?query=1', 'QUERY');
+----
+NULL
+
+query T
+SELECT parse_url('http://spark.apache.org:99999/path', 'HOST');
+----
+NULL
+
+# A malformed URL raises an error when ANSI mode is on
+statement ok
+set datafusion.execution.enable_ansi_mode = true;
Review Comment:
Optional: Before resetting ANSI mode, could we assert that
`try_parse_url('inva lid://spark.apache.org/path?query=1', 'QUERY')` returns
NULL? The existing tests cover this malformed input with ANSI disabled, so this
would additionally protect the tolerant function's behavior when ANSI mode is
enabled.
##########
datafusion/sqllogictest/test_files/spark/url/parse_url.slt:
##########
@@ -330,9 +330,30 @@ NULL
statement error 'parse_url' does not support zero arguments
SELECT parse_url();
+# A malformed URL returns NULL when ANSI mode is off (the default)
+query T
+SELECT parse_url('inva lid://spark.apache.org/path?query=1', 'QUERY');
Review Comment:
Optional: Could we add a SQL query over `VALUES` containing a valid URL, a
malformed URL, and NULL, passing the URL column and scalar `'HOST'` with ANSI
mode disabled? Asserting the valid host and two NULL results would extend the
existing unit coverage to mixed-row SQL execution and scalar-to-array
broadcasting.
--
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]