db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shahbaz chaudhary" <c_shah...@hotmail.com>
Subject derby's function system
Date Thu, 03 Feb 2005 08:45:23 GMT
<html><div style='background-color:'><P>A question about how some functionality
is implemented.&nbsp; It looks like several functions (actually all functions other than
the aggregate functions) are implemented along with their data types.&nbsp; For example
hour/day extractors seem to be part of SQLTime/SQLTimestamp/etc. data types.&nbsp; LENGTH/RTRIM/LTRIM
seem to be part of the string datatype.&nbsp; Isn't there a disconnect...while the aggregate
functions are laid out in a hierarchichal, scalar functions are not.</P>
<P>If I wanted a new datatype varcharx, will I have to reimplement all the string related
scalar functions?</P>
<P>What if I wanted to build a bridge to use an existing library of (scalar) functions,
won't this setup make that more difficult (think various regex libraries)?</P>
<P>Regarding aggregators, it looks like they are implemented by operating on two values
at a time (looking at SumAggregator): a value to be added and a value which was populated
previously (presumably containing aggregate result of column already traversed).</P>
<P>Again, if I wanted to build a bridge to existing libraries which might operate on
vectors rather than a scalar value, I would not be able to do that since most such libraries
expect to receive a whole set of values at once (in an array&nbsp;or List form).&nbsp;
I'm specifically thinking of the scientific COLT library.</P>
<P>How would I implement a typical 'approximating' function: an&nbsp;AVG which doesn't
sum up everything but SUMs x% of the values (randomly selected) and divides by x% of rows?&nbsp;
In other words, now I have to pass around another parameter or some sort of context object
which contains&nbsp;some extra information. (just an example of a possible problem)</P>
<P>Just trying to make sure the mental model of the code I've studied so far is an accurate
one.&nbsp; Thanks.</P>
<P>Falcon</P></div></html>


Mime
View raw message