Opened 9 years ago

Closed 8 years ago

#991 closed defect (wontfix)

marray iterator syntax not properly supported

Reported by: Dimitar Misev Owned by: Vlad Zamfir
Priority: major Milestone: 9.1.x
Component: qlparser Version: development
Keywords: Cc: Peter Baumann
Complexity: Medium

Description

This works

select encode(
marray i in [0:100]
values i[0]
, "csv")

however this doesn't, but should work as well equivalent as the above:

select encode(
marray i in [0:100]
values i
, "csv")

Same with the condenser iterators.

In fact I'm not sure why and if we want to support the first case at all (aside of backwards-compatibility).

Change History (5)

comment:1 by Peter Baumann, 9 years ago

yes, we do need both (again, actually, as it used to work already):

  • iteration vector is needed for
    marray p in [0:99, 0:99, 0:99]
    values p[0]+p[1]+p[2]
    
  • single values are needed for
    marray x in [0:99], y in [0:99]
    values x+y
    
Last edited 9 years ago by Peter Baumann (previous) (diff)

comment:2 by Peter Baumann, 9 years ago

…with the following semantics check:

  • an iteration variable without indexing is allowed only on 1D iterators
  • indexing is required on iterators >1D

Also, forgot to say that we might have mixed cases, too:

marray p in [0:99, 0:99, 0:99], time[0:99]
values p[0]+p[1]+p[2]+time

comment:3 by Dimitar Misev, 9 years ago

The

marray p in [0:99, 0:99, 0:99]
values p[0]+p[1]+p[2]

is quite confusing to newcomers from what I observed, they tend to think that [0:99, 0:99, 0:99] is therefore some sort of array. Is there some reason for this notation? Why not simply enforce

{{{
marray p in [0:99], q in [0:99], r in [0:99]
values p+q+r
}}}

comment:4 by Peter Baumann, 9 years ago

no need to expose to newcomers, but it is already in the syntax and we should not loose it.

comment:5 by Dimitar Misev, 8 years ago

Resolution: wontfix
Status: newclosed

I think we should close this (in favor of the mda syntax).

Note: See TracTickets for help on using tickets.