RE: SAG-FO-05: aggregate functions

Mike:
Thank you for all your work in this area!

At the joint meeting on 9/15/2003 the WGs decided to accept your
recommendations in principle but wanted a detailed proposal to look at
and approve.  You provided this in
http://lists.w3.org/Archives/Member/w3c-query-operators/2003Sep/0028.htm
l.  The WGs approved this, with minor modifications, in the joint
meeting yesterday.  See minutes
http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2003Oct/0011.html 

All the best, Ashok

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Kay, Michael
> Sent: Tuesday, June 10, 2003 8:50 AM
> To: public-qt-comments@w3.org
> Subject: SAG-FO-05: aggregate functions
> 
> 
> This point has been made elsewhere, but we wish to emphasize it, as it
> seems
> to be a serious design flaw.
> 
> The polymorphic nature of the aggregation functions, such as
min/max/avg,
> has not been thought through carefully enough.
> 
> It is important that these functions should be capable of a streamed
> implementation. This means that if the first 999 values in a sequence
are
> untyped atomic, the choice of comparison or addition operator should
not
> depend on the type of the 1000th item. (Note that "order by" in XQuery
has
> this right: untyped atomic values are treated as strings, irrespective
of
> the types of the other items in the sequence).
> 
> These functions (in particular sum) also have a problem in how they
handle
> the empty sequence. Because an empty set of doubles is not dynamically
> distinguishable from an empty set of durations, sum() applied to the
> latter
> returns the double value 0.0e0, which is in conflict with static
typing
> expectations. The only solution to this problem seems to be to stop
> overloading the sum() function to handle durations (as proposed in
> SAG-FO-02).
> 
> Michael Kay
> Software AG
> 

Received on Thursday, 2 October 2003 12:36:08 UTC