Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST_DUMP #1075

Open
ebocher opened this issue May 12, 2020 · 4 comments
Open

ST_DUMP #1075

ebocher opened this issue May 12, 2020 · 4 comments
Milestone

Comments

@ebocher
Copy link
Member

ebocher commented May 12, 2020

Add ST_DUMP function as
https://postgis.net/docs/ST_Dump.html

Not sure if H2 is today able to support a set-returning function

@katzyn

@katzyn
Copy link

katzyn commented May 12, 2020

H2 supports user-defined table value functions exactly is the same way as other user-defined functions, they simply need to return a java.sql.ResultSet.

@ebocher
Copy link
Member Author

ebocher commented May 12, 2020

We use it. But not sure if we can apply the same sql syntaxe as

SELECT sometable.field1, sometable.field1,
      (ST_Dump(sometable.the_geom)).geom AS the_geom
FROM sometable;

or

SELECT (a.p_geom).path[1] As path, ST_AsEWKT((a.p_geom).geom) As geom_ewkt
  FROM (SELECT ST_Dump(ST_GeomFromEWKT('POLYHEDRALSURFACE(
((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)), ((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),  ((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)),  ((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))
)') ) AS p_geom )  AS a;

@katzyn
Copy link

katzyn commented May 12, 2020

SELECT something FROM table_function(…) should work, other use cases aren't valid.

Current H2 also allows table value functions as plain expressions, such as SELECT table_function(…), but such support is a side effect of poorly designed implementation and it can be removed in the future versions.

SELECT (table_function()).something is not supported and is not going to be supported, such syntax in the SQL Standard is valid only for row value functions and is not yet supported by H2 even for them.

@ebocher
Copy link
Member Author

ebocher commented May 13, 2020

Thanks @katzyn
We are going to be vigilant on the use of the table functions

@ebocher ebocher added this to the H2GIS 2.X milestone Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants