Comment 9 for bug 1058398

Revision history for this message
Matthias Brantner (matthias-brantner) wrote : Re: [Bug 1058398] value-based sequence operations

Tricky question.

> Should these functions return distinct values? In thinking about it,
> there's no real reason why they have to. For example:
>
> let $s1 := (1, 2, 2, 3)
> let $s2 := (2, 3, 4)
> return seq:value-intersect( $s1, $s2 )
>
> COULD return:
>
> (2, 2, 3)
I would expect (2, 3, 4) because 2 appears only once in s2.
If we want to have this semantics, I don't see how it can be done efficiently.

Maybe we can have two functions:

1. one doing duplicate elimination
2. one not doing duplicate elimination

Maybe a third one could be used if both inputs are ordered.

Maybe we can talk on Skype quickly.

Matthias

>
> which would be the same as:
>
> $s1[ . = $s2 ]
>
> without using distinct-values()
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1058398
>
> Title:
> value-based sequence operations
>
> Status in Zorba - NoSQL Query Processor:
> In Progress
>
> Bug description:
> Implement the following value-based sequence function in a new
> sequence module:
>
> module namespace seq = "http://www.zorba-xquery.com/modules/sequence";
>
> declare function seq:value-intersect($seq1 as xs:anyAtomicType*, $seq2 as xs:anyAtomicType*) as xs:anyAtomicType*
> external;
>
> declare function seq:value-union($seq1 as xs:anyAtomicType*, $seq2 as
> xs:anyAtomicType*) as xs:anyAtomicType* external;
>
> declare function seq:value-except($seq1 as xs:anyAtomicType*, $seq2 as
> xs:anyAtomicType*) as xs:anyAtomicType* external;
>
> - The function should use value comparison but use false instead of an error in case of a type mismatch.
> - JSONiq module
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zorba/+bug/1058398/+subscriptions