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
Support for XQuery Tumbling and Sliding Window #4529
base: develop
Are you sure you want to change the base?
Support for XQuery Tumbling and Sliding Window #4529
Conversation
SonarCloud Quality Gate failed. 10 Bugs |
Very exciting! This works with all of the code from XQuery for Humanists in the sections on Windowing except for one, which apparently isn't tested in XQTS - and which I'll submit as a new test there. This query is: let $sentence := "This is a a test of of windowing"
let $words := fn:tokenize($sentence, " ")
for tumbling window $window in $words
start $ws at $wsn previous $wp next $wn
when $wp eq $ws
return
<window ws="{$ws}" wsn="{$wsn}" wp="{$wp}" wn="{$wn}">{ $window }</window> The results from this branch: <window ws="of" wsn="7" wp="of" wn="windowing">a test of</window>
<window ws="windowing" wsn="8" wp="of" wn="">of windowing</window> The expected results, as returned by BaseX and Saxon: <window ws="a" wsn="4" wp="a" wn="test">a test of</window>
<window ws="of" wsn="7" wp="of" wn="windowing">of windowing</window> (The window is selected correctly, but the variables bound by the Also, there seems to be one parser issue. The query: <x/>/@when ... returns the error:
From exist.log:
|
@adamretter I can confirm that with the last commit the |
87d963d
to
98ea402
Compare
ffa6299
to
adccc58
Compare
adccc58
to
e8a42da
Compare
932e2e5
to
37d432d
Compare
37d432d
to
7773cc2
Compare
SonarCloud Quality Gate failed. 10 Bugs |
dbc978b
to
02e1601
Compare
exist-core/src/main/java/org/exist/xquery/AbstractFLWORClause.java
Outdated
Show resolved
Hide resolved
02e1601
to
308c210
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change. This needs a rebase to resolve conflicts. It’s there content work still missing to no longer mark it as draft?
6b566e2
to
186418c
Compare
…e value (XQTS: prod-OrderByClause)
…sequence (XQTS: prod-OrderByClause)
…aracters (XQTS: prod-OrderByClause)
…oat and xs:double (XQTS: prod-OrderByClause)
…e-uri (XQTS: prod-OrderByClause)
…S: prod-OrderByClause)
… can be applied (XQTS: prod-OrderByClause)
…not find the indicated Collator
…asses the test twt:jw-duplicate-words#0
@reinhapa each of the 5 bugs listed by SonarCloud are false positives. I fixed a few small code smell issues highlighted by SonarCloud. The remaining suggestions from SonarCloud and Codacy otherwise IMHO make the code worse! |
72b7d4e
to
d118a3b
Compare
@adamretter there is a compile error on the test source:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compilation issue
This implements both
tumbling window
andsliding window
.Along the way to make sure it passes the Window tests in the XQTS. We also had to fix a number of other things:
fn:deep-equal
bug-fixesfn:codepoint-equal
oncefn:sort
group by
expression implementationNaN
values forxs:float
andxs:double
INF
and-INF
values forxs:float
andxs:double
op:same-key#2
for XQuery Map typesfn:deep-equal
in terms ofop:deepCompare
By running exist-xqts-runner (from its
compat/eXist-7.0.0-SNAPSHOT
branch):We see the results:
The 7 remaining Window failures are all related to the
count
clause which still needs to be implemented first in a separate PR, see: #4530.This open source contribution to the eXist-db project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.