jsoniq: pair value returns more then one item

Bug #1046411 reported by Dana Florescu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Markos Zaharioudakis

Bug Description

This query

{ "foo" : (1 to 3) }

should return

{ "foo" : [1,2,3] }

(automatic array construction)

Tags: jsoniq
Changed in zorba:
importance: Undecided → Critical
assignee: nobody → Ghislain Fourny (gislenius)
milestone: none → 3.0
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

If this is done, we also need to make sure that the solution is consistent with the following:

variable $object := {"foo": "bar"};

replace json value of $object("foo") with (1 to 3);

Revision history for this message
Till Westmann (tillw) wrote :

So then - in conjunction with bug #1046410 - the rule for constructing or replacing the value of a pair with the sequence $s is:

if count($s) eq 0 then jn:null()
else if count($s) eq 1 then $s
else [ $s ]

If we have this, should we give this operation a name (e.g. "jsonify")?

Till Westmann (tillw)
tags: added: jsoniq
Changed in zorba:
status: New → In Progress
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

According to the latest discussion, we need to do the following:

- implement a new iterator that does array-boxing of sequences and conversion of empty-sequence into null
- this iterator will be introduced during normalization within object constructors and replace expressions
- the optimizer could remove the iterator if it can detect statically that no boxing or conversion into null needs to be done

Changed in zorba:
assignee: Ghislain Fourny (gislenius) → Markos Zaharioudakis (markos-za)
milestone: 3.0 → 2.7
importance: Critical → High
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.