db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Functions in GROUP BY expressions? (related to DERBY-883)
Date Tue, 31 Oct 2006 23:28:30 GMT
Yip Ng wrote:

> I think what Dan meant was that all *user defined functions* defined via 
> CREATE FUNCTION statement are assumed to be non-deterministic since 
> users cannot declare a function as deterministic in the current 
> implementation of Derby, so implicitly, they are non-deterministic.



> For SIN, COS, TAN functions,  they are also considered deterministics.

SIN, COS etc. are implemented using the same mechanism as user defined 

> However, they do not work currently in Derby with group by expression as 
> they are mapped to  JavaToSQLValueNode and such nodes always return 
> false in isEquivalent() method, so I think this is an implementation 
> restriction for those built-in functions.

Right, ideally these builtin functions should be able to declare 
themselves as deterministic or not and the isEquivalent() method factor 
that into its decision. I'd like to see this handled the same way for 
the builtin Java SQL external functions (SIN, COS etc.) as for the user 
defined functions, rather than special casing the builtin ones.


View raw message