Explore PostgreSQL Datasource with JSONB array ERROR
See original GitHub issueError in Explore view when the underlining query filters a JSONB array in PostgreSQL that contains integer values.
Workaround Convert the integer value inside the JSONB array to string
what you expected to happen.
Since the query is working as expected in SQL Lab, we should be able to create a chart utilizing it.
what actually happens.
Screenshots
How to reproduce the bug
- Create a query in SQL Lab that filters a JSONB array in PostgreSQL, where the value is integer (example below)
- Create a datasource out of this query
- Error in Explore view when trying to create a chart
select * from jsonb_datasource WHERE jsonb_datasource.transactions @> '[{"transaction_status":"SUCCESS","transaction_id": 1}]'
Environment
- superset version: 0.37.0rc1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Explore PostgreSQL Datasource with JSONB array ERROR
Error in Explore view when the underlining query filters a JSONB array in PostgreSQL that contains integer values. Workaround
Read more >How to Query JSONB Array of Objects in PostgreSQL
Learn how to Query JSONB Array of Objects in PostgreSQL and perform CRUD operations like CREATE, INSERT, SELECT, UPDATE, DELETE on the ...
Read more >problem inserting json array into postgres: malformed error
I'm trying to insert an array of JSON values into a postgres database. But I'm getting this error: error: malformed array literal: ...
Read more >Using the value of a JSON object that is stored in a ...
Let's just go with it. I have been experimenting with the JSON functions and the array functions but I just can't seem to...
Read more >Working with a JSONB Array of Objects in PostgreSQL
In this article, I'd like to continue our work with a jsonb column containing an Array of Objects and explore how to,. Get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Correct, I tried explicitly adding a json string to a jsonb column and the space after the colon is added automatically.
I am closing this issue as resolved.
Thanks for your help @villebro
Thanks for the detailed reproduction case @GiannisDimitriou. I was able to reproduce the error, will investigate.