streaming and sequential flwor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Federico Cavalieri |
Bug Description
If a FLWOR has a sequential return clause, all of the binding sequences of the clauses are materialized before the return clause is executed. This behavior is correct according to the latest Scripting specification and avoids confusion if the return clause would modify any input to one of the clauses.
However, the downside is that there is currently no way to stream the input. For example, in the following query, $contents is completely materialized before the sequential local:test function is invoked.
variable $xmlcontents := fetch:content(
let $contents := parse-xml:parse(
$xmlcontents,
<opt:options>
<
for $w at $pos in $contents
return
{
local:test();
$w
}
There has been an extensive discussion on zorba-dev (subject "Streaming and Sequential FLWOR -> no good") on this topic but no satisfying solution has been found, yet.
Related branches
- Markos Zaharioudakis: Approve
- Matthias Brantner: Approve
-
Diff: 993 lines (+563/-31)31 files modifiedinclude/zorba/pregenerated/diagnostic_list.h (+2/-0)
modules/pregenerated/zorba-errors.xq (+4/-0)
src/compiler/codegen/plan_visitor.cpp (+8/-7)
src/compiler/expression/flwor_expr.cpp (+22/-1)
src/compiler/expression/flwor_expr.h (+5/-2)
src/compiler/parser/parser.y (+4/-10)
src/compiler/parsetree/parsenodes.h (+1/-1)
src/compiler/translator/translator.cpp (+27/-0)
src/diagnostics/diagnostic_en.xml (+5/-1)
src/diagnostics/pregenerated/diagnostic_list.cpp (+3/-0)
src/diagnostics/pregenerated/dict_en.cpp (+2/-1)
src/store/naive/simple_collection.cpp (+25/-6)
src/store/naive/simple_collection.h (+3/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor24.iter (+56/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor25.iter (+56/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor26.iter (+66/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor27.iter (+63/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/flwor/flwor28.iter (+57/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor25.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor27.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/flwor/flwor28.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/scripting/flwor2.xml.res (+0/-2)
test/rbkt/Queries/zorba/flwor/flwor24.xml (+5/-0)
test/rbkt/Queries/zorba/flwor/flwor24.xq (+25/-0)
test/rbkt/Queries/zorba/flwor/flwor25.xq (+29/-0)
test/rbkt/Queries/zorba/flwor/flwor26.spec (+1/-0)
test/rbkt/Queries/zorba/flwor/flwor26.xq (+30/-0)
test/rbkt/Queries/zorba/flwor/flwor27.xq (+30/-0)
test/rbkt/Queries/zorba/flwor/flwor28.xq (+29/-0)
test/rbkt/Queries/zorba/scripting/flwor2.spec (+1/-0)
Changed in zorba: | |
milestone: | 2.7 → none |
assignee: | Ghislain Fourny (gislenius) → Markos Zaharioudakis (markos-za) |
Changed in zorba: | |
assignee: | Markos Zaharioudakis (markos-za) → Matthias Brantner (matthias-brantner) |
milestone: | none → 2.8 |
Changed in zorba: | |
milestone: | 2.8 → 2.9 |
Changed in zorba: | |
milestone: | 2.9 → 3.0 |
tags: | added: compiler performance-problem |
Changed in zorba: | |
status: | New → Confirmed |
Changed in zorba: | |
assignee: | Matthias Brantner (matthias-brantner) → Federico Cavalieri (fcavalieri) |
status: | Confirmed → In Progress |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
I am assigning to Ghislain simply to ensure that it stays on my planning spreadsheet.