Created
February 7, 2014 00:42
-
-
Save jeromebanks/8855457 to your computer and use it in GitHub Desktop.
to_json with named_struct
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
select | |
to_json( named_struct("key1", 0, "key2", "a string val", "key3", array( 4,5,6), "key4", map("a",2.3,"b",5.6) )) | |
from mytable; | |
Output is | |
' { "key1":0, "key2":"a string val", "key3":[4,5,6], "key4":{"a":2.3, "b":5.6} } ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment