Using FOR XML RAW in Spark SQL

AzaharNadaf
Databricks Partner

How can I convert below SQL server query to spark SQL 

Query - SELECT distinct HashBytes('md5', (SELECT a, b, c for xml raw)) as xyzzy  FROM table name

Need help here community 🙂

AzaharNadaf
Databricks Partner

Also need to find out here how to use multiple columns in md5 function as above

AzaharNadaf
Databricks Partner

The Idea here was to create a unique id based upon the number of columns, 

I have used dense Rank to resolve this issue

Thanks

View solution in original post