Hi, I think I understand the problem now, looking at your test cases testTableFunctionGeometry and testAggregateWithGeometry.
I'm not quite sure yet what is the best way to solve the problem. About SimpleResultSet: Your solution seems to be straightforward, I will try to apply it. About Aggregates: Maybe there is a simpler solution. I'm not convinced yet that using type names is the best solution. The H2 database internally uses value types (Value.GEOMETRY for example). Maybe instead of using type names, value types could be used? There would still be a change needed for the AggregateFunction API, possibly a new interface. But the class ColumnType would not be needed. Regards, Thomas On Wed, Dec 18, 2013 at 6:42 PM, Nicolas Fortin (OrbisGIS) < [email protected]> wrote: > Hi, > > > As far as I understand, you changed the Aggregate API quite a bit, in >> order to add the SQL type _name_ >> > I change the API in order to stay backward-compatible on dependency > upgrade. > > > But why not for regular results sets of H2? Why not for other user defined >> functions, triggers, and so on? >> > The sql type name is needed only when the objects are not yet available. > JDBC API says type name should return a fully qualified type > namehttp://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnTypeName%28int%29. > In h2 user defined aggregate expose function signature only through integer > sql types; then when we create a table from the result of an aggregate; h2 > first create the table using only aggregate signature, not values (as they > are not available yet). > > > But why not for regular results sets of H2 >> > I don't understand what is a regular result set of h2. > > > -Nicolas Fortin > IRSTV FR CNRS 2488 > > Le mercredi 18 décembre 2013 17:25:37 UTC+1, Thomas Mueller a écrit : >> >> Hi, >> >> Yes, sorry for the delay. I have a few questions. As far as I understand, >> you changed the Aggregate API quite a bit, in order to add the SQL type >> _name_ (in addition to the SQL type value such as Types.OTHER). The same >> for the SimpleResultSet. >> >> The JDBC API uses the SQL type, but doesn't use the SQL type name in many >> places (PreparedStatement.setObject and so on doesn't use it; but >> ResultSetMetaData.getColumnTypeName does). I wonder why is it needed >> specially for user defined aggregate functions? I can understand it is >> useful for SimpleResultSet. But why not for regular results sets of H2? Why >> not for other user defined functions, triggers, and so on? >> >> Regards, >> Thomas >> >> >> >> >> >> On Wed, Dec 18, 2013 at 1:34 PM, Nicolas Fortin (OrbisGIS) < >> [email protected]> wrote: >> >>> Hi, >>> >>> It is ok for geometry optimisation. What about TypeName ? >>> >>> This patch is really important for table function and aggregation >>> function that involve OTHER or JAVA_OBJECT type. >>> >>> >>> https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type >>> >>> >>> https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.diff<https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type> >>> https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.patch<https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type> >>> >>> Thank you >>> >>> -Nicolas Fortin >>> IRSTV FR CNRS 2488 >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "H2 Database" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> >>> Visit this group at http://groups.google.com/group/h2-database. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
