Skip to content

Instantly share code, notes, and snippets.

@jeromebanks
Created February 7, 2014 00:37
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/8855408 to your computer and use it in GitHub Desktop.
Save jeromebanks/8855408 to your computer and use it in GitHub Desktop.
from_json using named_struct
select
from_json(' { "key1":"string value", "key2":2.1, "key3":560000 }',
named_struct("key1", "", "key2", cast(0.0 as double), "key3", cast(1 as bigint) ) )
from mytable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment