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

Bertil Chapuis commented on CALCITE-5281:
-----------------------------------------

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

I drafted a PR for the ST_Explode function and the following query returns the 
expected result:
{code:sql}
SELECT * FROM table(ST_Explode(ST_GeomFromText('MULTIPOINT((1 1), (2 2), (3 3), 
(4 4))')));
geom
POINT (1 1)
POINT (2 2)
POINT (3 3)
POINT (4 4){code}
However, I would like to cover more advanced cases similar to ST_Dump such as 
the following:
{code:sql}
SELECT * FROM table(ST_ExplodeCursor(cursor(
SELECT ST_GeomFromText('MULTIPOINT((1 1), (2 2))'))
UNION
SELECT ST_GeomFromText('MULTIPOINT((3 3), (4 4))'))
)) {code}
My initial idea was to implement something similar to 
TableFunctionTest.testTableFunctionCursorInputs before realizing that this test 
was disabled. Is there another way to achieve similar results?

> Implement geometry set returning functions (SRF)
> ------------------------------------------------
>
>                 Key: CALCITE-5281
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5281
>             Project: Calcite
>          Issue Type: Improvement
>          Components: spatial
>            Reporter: Bertil Chapuis
>            Assignee: Bertil Chapuis
>            Priority: Minor
>
> The idea is to implement set returning functions, such as ST_Explode in H2GIS 
> and ST_Dump in PostGIS. Is the Uncollect class a good starting point?



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

Reply via email to