Skip to content

Instantly share code, notes, and snippets.

@jthandy
Created May 14, 2019 00:43
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 jthandy/b96e74644391ba27c34ebf4c293c939f to your computer and use it in GitHub Desktop.
Save jthandy/b96e74644391ba27c34ebf4c293c939f to your computer and use it in GitHub Desktop.
a test dataset for some work with Redshift flattening.
create table dbt_jthandy.flatten_test (
order_id int,
json_text varchar(1000)
)
;
insert into dbt_jthandy.flatten_test
(order_id, json_text)
values
(1, '{
"items":[
{
"id":"fa4b6cd3-4719-4b97-848b-7f2025f5e693",
"quantity":1,
"sku":"M900353-SWB-RYL-2",
"list_price":60.0
},
{
"id":"c39f9474-a278-4162-9cfa-aa068f4e1665",
"quantity":1,
"sku":"F033199-SWB-FWL-1",
"list_price":20.0
}
]}')
;
insert into dbt_jthandy.flatten_test
(order_id, json_text)
values
(2, '{
"items":[
{
"id":"fa4b6cd3-4719-4b97-848b-7f2025f5e693",
"quantity":1,
"sku":"M900353-SWB-RYL-2",
"list_price":60.0
}
]}')
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment