Created
June 11, 2020 07:58
-
-
Save velotiotech/262572cec7d0373ab52bc0178d565400 to your computer and use it in GitHub Desktop.
converting json to athena data type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH dataset AS ( | |
SELECT | |
CAST(JSON '"HELLO ATHENA"' AS VARCHAR) AS hello_msg, | |
CAST(JSON '12345' AS INTEGER) AS some_int, | |
CAST(JSON '{"a":1,"b":2}' AS MAP(VARCHAR, INTEGER)) AS some_map | |
) | |
SELECT * FROM dataset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment