https://github.com/a-b/redshift-json-query-generator
Generate RedShift query to parse and flatten JSON
https://github.com/a-b/redshift-json-query-generator
Last synced: 5 months ago
JSON representation
Generate RedShift query to parse and flatten JSON
- Host: GitHub
- URL: https://github.com/a-b/redshift-json-query-generator
- Owner: a-b
- Created: 2020-09-25T16:33:13.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-27T20:05:50.000Z (almost 6 years ago)
- Last Synced: 2025-10-18T02:20:44.875Z (9 months ago)
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Redshift JSON query generator
Generate RedShift query to parse and flatten JSON
# Problem statement
We need to parse JSON data stored in AWS Redshift into the table columns.
# Solution
Write query generator that can parse JSON structure as input and output Redshift SELECT query that extract each JSON value into the separate column.
# Notes
AWS Redshift has couple functions to work with JSON data:
1. https://docs.aws.amazon.com/redshift/latest/dg/JSON_EXTRACT_PATH_TEXT.html
1. https://docs.aws.amazon.com/redshift/latest/dg/JSON_EXTRACT_ARRAY_ELEMENT_TEXT.html
That should be sufficient to parce andy JSON, since by specs it consists of paris of key-values and ararays.