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.

Yes.

[snip]

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

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

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.

Dan.


Reply via email to