Skip to content

Instantly share code, notes, and snippets.

@jeromebanks
Created February 7, 2014 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromebanks/8873467 to your computer and use it in GitHub Desktop.
Save jeromebanks/8873467 to your computer and use it in GitHub Desktop.
to_json converting from snake_case to CamelCase
select
to_json(
named_struct("camel_case", 1,
"big_double", 9999.99,
"the_really_cool_value", "a string val",
"another_array", array( 4,5,6),
"random_map", map("a",2.3,"b",5.6) ), true)
from mytable;
Output:
{"camelCase":1,"bigDouble":9999.99,"theReallyCoolValue":"a string val","anotherArray":[4,5,6],"randomMap":{"b":5.6,"a":2.3}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment