art000109 opened a new issue, #57534:
URL: https://github.com/apache/spark/issues/57534

   Currently, the `decode` function is used only for decoding strings. However, 
a `CASE WHEN` equivalent has been available in the Spark SQL API since version 
3.2.0
   
   https://spark.apache.org/docs/latest/api/sql/string-functions/#decode
   
   ```
   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
    abc
   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 
'Seattle', 'Non domestic');
    Non domestic
   ```


-- 
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]

Reply via email to