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