Jefffrey commented on PR #17485:
URL: https://github.com/apache/datafusion/pull/17485#issuecomment-3345716162
Looks like some test failures:
```sql
1. query result mismatch:
[SQL] SELECT
parse_url('http://[email protected]/path?query=1#Ref'::string,
'AUTHORITY'::string);
[Diff] (-expected|+actual)
- [email protected]
+ [email protected]:80
at
/Users/jeffrey/Code/datafusion/datafusion/sqllogictest/test_files/spark/url/parse_url.slt:63
2. query failed: DataFusion error: Execution error: RelativeUrlWithoutBase
[SQL] SELECT parse_url('www.example.com/path?x=1', 'HOST');
at
/Users/jeffrey/Code/datafusion/datafusion/sqllogictest/test_files/spark/url/parse_url.slt:83
3. query failed: DataFusion error: Execution error: RelativeUrlWithoutBase
[SQL] SELECT parse_url('www.example.com/path?x=1', 'host');
at
/Users/jeffrey/Code/datafusion/datafusion/sqllogictest/test_files/spark/url/parse_url.slt:88
4. query failed: DataFusion error: Execution error: RelativeUrlWithoutBase
[SQL] SELECT parse_url('notaurl', 'HOST');
at
/Users/jeffrey/Code/datafusion/datafusion/sqllogictest/test_files/spark/url/parse_url.slt:133
5. query failed: DataFusion error: Execution error: RelativeUrlWithoutBase
[SQL] SELECT parse_url('notaurl', 'host');
at
/Users/jeffrey/Code/datafusion/datafusion/sqllogictest/test_files/spark/url/parse_url.slt:138
```
For reference I checked expected outputs against Spark 4.0.0:
```sql
spark-sql (default)> SELECT
parse_url('http://[email protected]/path?query=1#Ref'::string,
'AUTHORITY'::string);
[email protected]
Time taken: 0.779 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT parse_url('www.example.com/path?x=1', 'HOST');
NULL
Time taken: 0.054 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT parse_url('www.example.com/path?x=1', 'host');
NULL
Time taken: 0.041 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT parse_url('notaurl', 'HOST');
NULL
Time taken: 0.022 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT parse_url('notaurl', 'host');
NULL
Time taken: 0.021 seconds, Fetched 1 row(s)
spark-sql (default)>
```
Also I noticed we don't have a test that shows the difference between
`parse_url` and `try_parse_url`; we could use this one from the Spark docs:
https://spark.apache.org/docs/latest/api/sql/index.html#try_parse_url
`SELECT try_parse_url('inva lid://spark.apache.org/path?query=1', 'QUERY');`
Where for `parse_url` it errors as expected but `try_parse_url` returns null
--
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]