@Maryam Najafianโ :
The reason why you are getting this error is that the spark.sql.mapKeyDedupPolicy configuration is not available in SQL Warehouse clusters. This configuration is specific to Spark clusters and is not supported in SQL Warehouse.
To work around this error, you can try using an alternative approach to parsing the string into a map. One approach is to split the string into an array of key-value pairs, and then use the map_from_arrays function to convert the array into a map. Here's an example:
SELECT map_from_arrays(
transform(
split('key1:value1,key2:value2,key3:value3', ','),
x -> split(x, ':')
)
)
In this example, we first split the input string into an array of key-value pairs using the split function. We then transform this array to create an array of arrays, where each inner array contains two elements (the key and value). Finally, we use the map_from_arrays function to create a map from the array of arrays.
Note that this approach assumes that the input string is well-formed and does not contain duplicate keys. If the input data may contain duplicate keys, you can add additional logic to handle this case, such as using the array_distinct function to remove duplicate keys before converting the array to a map.