Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax type incompatibility in order by clause (impl. dep. instead of XPST0004) #42

Closed
ghislainfourny opened this issue Jan 5, 2021 · 4 comments
Labels
Enhancement A change or improvement to an existing feature Propose Closing with No Action The WG should consider closing this issue with no action XQuery An issue related to XQuery

Comments

@ghislainfourny
Copy link

ghislainfourny commented Jan 5, 2021

In the case where XQuery is used with very large sequences (billions/trillions of items or of tuples) with a parallel evaluation [1], the order by clause in its current state is costly to evaluate, because checking the primitive types for compatibility requires an extra step and materialization (in the case of Spark: an additional action to perform this check).

Relaxing this by making the order between different primitive types implementation-dependent (for the purpose of order by) rather than throwing XPST0004, in case of several incompatible primitive types in the comparison keys, would make parallel implementations more efficient.

[1] http://www.vldb.org/pvldb/vol14/p498-muller.pdf

@ghislainfourny ghislainfourny changed the title Relax type incompatibility in order by clause Relax type incompatibility in order by clause (impl. dep. instead of XPST0004) Jan 5, 2021
@michaelhkay
Copy link
Contributor

Presumably this rule also causes problems:

If each value is an instance of one of the types xs:decimal or xs:float, then all values are cast to type xs:float.

Because you don't know how to compare two decimals until you know whether the sequence also contains an xs:float and/or an xs:double.

With the new rules for numeric "lt", I think we can change that.

I'd like to avoid any further divergence between XQuery order by, XPath fn:sort(), and XSLT xsl:sort

@ghislainfourny
Copy link
Author

Indeed, this rule also jointly contributes to the problem. The extra materialization step is also needed because of it. The output of this extra step is the overall type to use (or an error), and then sorting happens in another round by casting everything to that overall type.

@rhdunn rhdunn added XPath An issue related to XPath XQuery An issue related to XQuery XQFO An issue related to Functions and Operators Enhancement A change or improvement to an existing feature and removed XPath An issue related to XPath XQFO An issue related to Functions and Operators labels Sep 14, 2022
@ChristianGruen
Copy link
Contributor

Has the problem been mitigated by #866/#881?
If yes, should we close the issue?

@ChristianGruen ChristianGruen added the Propose Closing with No Action The WG should consider closing this issue with no action label Feb 7, 2024
@ndw
Copy link
Contributor

ndw commented Feb 13, 2024

The CG agreed to close this issue without action at meeting 065

@ndw ndw closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A change or improvement to an existing feature Propose Closing with No Action The WG should consider closing this issue with no action XQuery An issue related to XQuery
Projects
None yet
Development

No branches or pull requests

5 participants