Querying JSON Strings in AWS Redshift Querying JSON Strings in AWS Redshift json json

Querying JSON Strings in AWS Redshift


It is not possible to do what you want using your current schema with plain SQL.

If you can have application logic when creating your SQL query, you could dynamically create the SELECT statement.

Option A

Load the whole JSON in your app, parse it and obtain the required information this way.

Option B

When storing values in your database, parse the JSON object and add the discovered keys to another table. When querying your Redshift cluster, load this list of values and generate the appropriate SQL statement using this information.

Here's hoping these workarounds can be applied to your situation.