Hi Konstantin,

That change to the return statement worked. Thanks.

Marijan (Mario) Madunic

On 8/9/2012 6:51 AM, Konstantin Abakumov wrote:
Hello again, Marijan!

    The first variable (l_Content1) the IDs are output in the order
    they were sorted and appear in the XML file but the second
    variable's (l_Content2) the IDs do not appear in the sorted order
    but the output XML file has them in the sorted order. I find this
    confusing as to why this is happening. Both variables contain the
    exact same data.


We have investigated how Sedna works in such cases and can suggest you to change your query a bit. In the end of the query, you have to modify this text:
...
return
$l_Content2/@id

in a such way:
...
return
for $i in $l_Content2 return $i/@id

After this, sequence l_Content2 should be returned in sorted (as you requested in order by) order.

Here some explanation of this:

In Sedna, result of axis step ($l_Content2*/*@id in our case) operation returned strictly in document order (informally, document order is the order in which nodes appear in the XML serialization of a document), so previous appliance of order by operation is lost.

Here some citations from XQuery standard about this:
http://www.w3.org/TR/xquery/#doc-xquery-AxisStep
http://www.w3.org/TR/xquery/#id-unordered-expressions

Unfortunately, we see some ambiguity describing the case and cannot determine whether Sedna performs right or not. So our team will continue the investigation and maybe this issue will be marked as a bug. Meanwhile you can use suggested modification to the query.

Thank your for reporting the case!

--
Best regards,
Konstantin Abakumov.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to