w3c / qtspecs

XSLT and XQuery Specifications - the source used to build the specs, and the errata
Other
30 stars 25 forks source link

[xq30][xq31] No explicit mention that the grouping key used in the post-grouping tuple is implementation-dependent? #6

Open ghislainfourny opened 4 years ago

ghislainfourny commented 4 years ago

I just noticed that in this paragraph on group by clauses:

"The pre-grouping tuples from which the group is derived have equivalent grouping keys, but these keys are not necessarily identical (for example, the strings "Frog" and "frog" might be equivalent according to the collation in use.) In the post-grouping tuple, each grouping variable is bound to the value of the corresponding grouping key."

It says "the" grouping key, although the sentence before reminds that there may be several equivalent but non identical grouping keys.

My recollection of our intent was that the specific grouping key that is used in the post-grouping tuple, if there are several different (yet equivalent) values in the pre-grouping tuple, is implementation-dependent, but I cannot find it explicitly said.

Example

for $x in (xs:yearMonthDuration("P0Y"), xs:dayTimeDuration("P0D"))
group by $x
return $x

can return either value.

Or I am missing something?