superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] GiannisDimitriou commented on issue #10754: Explore PostgreSQL Datasource with JSONB array ERROR
Date Mon, 07 Sep 2020 09:30:23 GMT

GiannisDimitriou commented on issue #10754:
URL: https://github.com/apache/incubator-superset/issues/10754#issuecomment-688198453


   After checking PostgreSQL behaviour I see that a space is added automatically after the
colon character when using the jsonb_agg function. I haven't check though what is the behaviour
when trying to insert a json string explicitly in an json/jsonb column.
   So for this example adding the space on the filter clause only, its fine.
   
   Yeah I get your point I will check if there is any way to escape JSON and reply back.
   
   @villebro I don't think inserting non-spaced JSON objects in a JSON or JSONB column will
cause trouble, it's only the query that needs to have the space.
   
   In fact the JSON object it self must have a space as well for this to work.
   Check this example..same error 
   
   `SELECT * 
   FROM ( 
   SELECT * 
   FROM ( 
   VALUES 
   (1::int,'[{"transaction_status":"SUCCESS","transaction_id":1},{"transaction_status":"SUCCESS","transaction_id":2}]'::jsonb),

   (2::int,'[{"transaction_status":"PENDING","transaction_id":3},{"transaction_status":"CANCEL","transaction_id":4}]'::jsonb)
) 
   s(id, transaction_details) ) t 
   WHERE transaction_details @> '[{"transaction_status":"SUCCESS","transaction_id": 1}]'`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Mime
View raw message