Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save velotiotech/262572cec7d0373ab52bc0178d565400 to your computer and use it in GitHub Desktop.
Save velotiotech/262572cec7d0373ab52bc0178d565400 to your computer and use it in GitHub Desktop.
converting json to athena data type
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