Skip to content

Grouping all max issues  #7981

@jobergum

Description

@jobergum

Using the sample data in the https://github.com/vespa-engine/sample-apps/tree/master/part-purchases-demo we can observe the following

all( group(customer) 
        each(output(max(price)as(maxPrice)) 
        all(max(1) each(output(summary())) as(representative))))

Returns only 1 unique customer as if the max(1) had been applied before the topmost each. Without the all() we get the correct behavior:

all( group(customer)
        each(output(max(price)as(maxPrice))
        max(1) each(output(summary())) as(representative))))

Which returns the 3 unique customer groups.

In addition this is even more odd as in this case we get 3 unique customer groups but the representative hitlist is missing for two out of 3 groups.

all( group(customer) 
        each(output(max(price)as(maxPrice)) 
        all(max(1) each(output(summary())) as(representative)) 
        all(group(date) each( output(count() as(itemCount)) output(sum(price)) all( group(item) each(max(69) output(count()) each(output(summary())))) ) ) ) )

Renders 3 unique customers but only renders the 'represenative' hitlist for the first group, the following works as expected with 3 customer groups, each with a representative hitlist.

all( group(customer) 
        each(output(max(price)as(maxPrice))
         max(1) each(output(summary())) as(representative)
         all(group(date) 
                each( output(count() as(itemCount)) output(sum(price)) 
                 all(
                        group(item) each(max(69) output(count()) each(output(summary()))))
                 )
         )
        )
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions