You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Bertil Chapuis (Jira)" <ji...@apache.org> on 2022/09/13 06:11:00 UTC

[jira] [Comment Edited] (CALCITE-5276) Implicitly convert strings to geometries

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

Bertil Chapuis edited comment on CALCITE-5276 at 9/13/22 6:10 AM:
------------------------------------------------------------------

I started experimenting with implicit conversion, however, I have some trouble finding where the cast operation should be implemented in calcite. More precisely, I have to use the wkt parser when casting a varchar to a geometry or the wkb parser when casting a varbinary to a geometry.

Here are the modifications performed in my ongoing attemps.

[https://github.com/apache/calcite/pull/2905]

 


was (Author: bchapuis):
I started experimenting with implicit conversion, however, I have some trouble finding where the cast operation should be implemented in calcite. More precisely, I probably have to use the wkt parser when casting a varchar to a geometry or the wkb parser when casting a varbinary to a geometry.

Here are the modifications performed in my ongoing attemps.

[https://github.com/apache/calcite/pull/2905]

 

> Implicitly convert strings to geometries
> ----------------------------------------
>
>                 Key: CALCITE-5276
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5276
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Bertil Chapuis
>            Assignee: Bertil Chapuis
>            Priority: Minor
>
> Postgis and H2GIS implicitly transform strings into a geometries so that one can write the following query:
> {{SELECT ST_AsText('POINT(-71.064544 42.28787)');}}
> Instead of:
> {{SELECT ST_AsText(ST_GeomFromText('POINT(-71.064544 42.28787)'));}}
>  supports this kind of conversion. Should I introduce a new SqlTypeTranform (TO_GEOMETRY)? Thanks a lot for your help, I'm still discovering the internals of calcite. 
> The idea would be to introduce a SqlTypeTransform, change the SqlTypeAssignmentRule (see CALCITE-3550), add tests in TypeCoercionTest, and update the doc. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)