[
https://issues.apache.org/jira/browse/CALCITE-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Jonsson updated CALCITE-4739:
------------------------------------
Description:
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
was:
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
Priority: Minor (was: Major)
> 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
>
> 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.3.4#803005)