[Bug 15044] [XQuery30] group by variables with associated expressions

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15044

Jonathan Robie <jonathan.robie@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #2 from Jonathan Robie <jonathan.robie@gmail.com> 2011-12-10 17:38:50 UTC ---
I went back and looked at the proposal and the text more carefully, and I think
the current text and example are correct.

Your proposal assumes the old group by semantics, and defines the new semantics
in terms of it. As I implemented it, I reversed this. The current text is based
on the new definition in Mike Kay's proposal, which simplified the model, and
defines the semantics of a GroupingSpec that does not contain an ExprSingle by
doing a transformation to a GroupingSpec that does.

I modified the example accordingly. The direction of the transformation is
reversed.

Here's the text from your proposal:

<quote src="Andrew's Proposal">
If a group by clause contains variables that are bound to values, then it 
is semantically equivalent to one or more let clauses followed by a 
simplified group by clause, each containing variable that is not bound to 
a value. 

For example, the clause

group by $g1, $g2 := $expr1, $g3 := $expr2 collation "Spanish"

is semantically equivalent to the following sequence of clauses:

let $g2 := $expr1
let $g3 := $expr2
group by $g1, $g2, $g3 collation "Spanish"
</quote>

Here's the corresponding text as implemented:

<quote src="Current Internal Working Draft">
For each pre-grouping tuple, the grouping keys are computed by evaluating the
expression in the GroupingSpec and atomizing the result. If the GroupingSpec
does not contain an ExprSingle, an implicit expression is created, consisting
of a variable reference with the same name as the grouping variable. Thus,

group by $g1 collation "Spanish"

is equivalent to:

group by $g1 := $g1 collation "Spanish"
</quote>

-- 
Configure bugmail: https://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, 10 December 2011 17:38:52 UTC