- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-07-2025 05:00 PM
Hello @turagittech ,
Honestly, it all depends on how complex your URLs can get.
UDFs will always be more flexible but less performant than native SQL functions.
That said, if your team mainly works with SQL, trying to solve it natively in Databricks SQL is definitely a valid option.
For the path part, it really depends on how much detail you actually need to keep ā whether you just need the last element or the full structure.
But for the query string part, Iād recommend building a map of key-value pairs, which works really well in SQL:
map_from_arrays(
transform(split(parse_url(url, 'QUERY'), '&'), x -> split_part(x, '=', 1)),
transform(split(parse_url(url, 'QUERY'), '&'), x -> split_part(x, '=', 2))
) AS query_map
If you could share an example of a more complex URL, we could probably build something more tailored that handles both the path and query parts more dynamically.ā
Hope this helps, š
Isi