[ 
https://issues.apache.org/jira/browse/CALCITE-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501128#comment-17501128
 ] 

xiong duan commented on CALCITE-4739:
-------------------------------------

[~MartinJon]. Please describe the SQL should be in PostgreSQL. And maybe you 
can add some unit tests in RelToSqlConverterTest.

> 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
>            Priority: Minor
>              Labels: Bug, pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.
> Actually, own integration test show that pushdown is prevented when using the 
> clone functionality in the schema. This should probably be clarified 
> somewhere.
> I still wonder if code pushdown should not be implemented for postgres. I 
> leave this open for now.
> Many thanks 
> Martin Jonsson
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to