Martin Jonsson created CALCITE-4739:
---------------------------------------

             Summary: json_object pushdown JDBC Postgresql
                 Key: CALCITE-4739
                 URL: https://issues.apache.org/jira/browse/CALCITE-4739
             Project: Calcite
          Issue Type: Bug
          Components: jdbc-adapter
    Affects Versions: 1.27.0
         Environment: Calcite 1.27

Postgres 12
            Reporter: Martin Jonsson


I'm going through the JSON functions with JDBC Postgresql. Most functions work 
well but this is what my postgresql sees when usingĀ json_object:

SELECT "product_id", +JSON_OBJECT+(KEY 'name' VALUE "name" NULL ON NULL) AS 
"$f1"SELECT "product_id", JSON_OBJECT(+KEY 'name' VALUE+ "name" NULL ON NULL) 
AS "$f1" FROM "public"."products"

This is obviously not valid postgres sql syntax. So we have the JDBC adapter 
pushing down the calcite sql syntax to postgres. Note that for json_arrayagg 
this is not the case and there it seems to work as expected.

Neither can i find any tests for jdbc and functions json_object, json_arrayagg 
and json_objectagg.

I believe this is a bug. I could not find any setting that disable postgres 
pushdown for json functions and if there is one, it should be uniformly applied.

Many thanksĀ 

Martin Jonsson



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to