W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2009

[Bug 6647] [XQuery11UC] Windowing use case Q17: Invalid query

From: <bugzilla@wiggum.w3.org>
Date: Sat, 07 Mar 2009 14:41:43 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Lfxih-0002nP-Ub@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=6647


Tim Kraska <tim@flworfound.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim@flworfound.org




--- Comment #1 from Tim Kraska <tim@flworfound.org>  2009-03-07 14:41:43 ---
1) "newstart" defines a tumbling window which opens a new window in the moment
the start condition is fullfiled. Here the start condition defines the
beginning of a new day and thus the end of the previous day. Hence, "newstart"
should be correct.

2) I agree, it has to be day-from-dateTime. 
Additionally, the explicit cast could be avoided since the XML-Schema for Q17
already states that the attribute is of the type type xs:dateTime. However, I
leave it as it is for the moment.

The query with the day-from-dateTime change would be:

for tumbling window $w in $seq/sequence/* 
  start  $cur previous $prev 
   when day-from-dateTime(xs:dateTime($cur/@date)) ne
day-from-dateTime(xs:dateTime($prev/@date)) or empty($prev)
  end when newstart
return
  <mostValuableCustomer endOfDay="{xs:dateTime($cur/@date)}">{
    let $companies :=   for $x in distinct-values($w/@billTo ) 
                        return <amount company="{$x}">{sum($w[@billTo eq
$x]/@total)}</amount>
    let $max := max($companies) 
    for $company in $companies
    where $company eq xs:untypedAtomic($max)
    return $company
  }</mostValuableCustomer>
}</result>


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Saturday, 7 March 2009 14:41:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:56 GMT