question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explore PostgreSQL Datasource with JSONB array ERROR

See original GitHub issue

Error 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

image

How to reproduce the bug

  1. Create a query in SQL Lab that filters a JSONB array in PostgreSQL, where the value is integer (example below)
  2. Create a datasource out of this query
  3. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
GiannisDimitrioucommented, Sep 7, 2020

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

1reaction
villebrocommented, Sep 7, 2020

Thanks for the detailed reproduction case @GiannisDimitriou. I was able to reproduce the error, will investigate.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found