Reputation: 508
I am attempting to modify a vespa query in my code base. I am grouping in this query to collect min/max values. But now I am wanting to gather a max value for a value called operatingWeight. The issue I am seeing is that when I get that max value from my query it is always way higher than any value in the database for operating weight. My assumption is that there are some values in the data base that are decimal values not whole numbers and this is throwing off the max value. This is the grouping portion of my query:
all(
all( group(make) each( group(model) each( output(count()) ) ) )
all( group(categoryId) each( output(count()) ) )
all( group(1) each( output(min(price), max(price)) ) as(priceRange) )
all( group(1) each( output(min(hours), max(hours)) ) as(hoursRange) )
all( group(1) each( output(max(operatingWeight)) ) as(maxOperatingWeight) )
)
is there a way to modify the operatingWeight grouping to only account for whole numbers to test my theory? I've tried a few solutions like:
all( group(1) where((operatingWeight % 1) == 0) each(output(max(operatingWeight))) as(maxOperatingWeight) )
This errors and all my other attempts do as well... I am well versed in sql but yql is giving me trouble. Has anyone tried anything like this?
Upvotes: 0
Views: 54
Reputation: 996
It could be that operatingWeight
is not set for all the values you group over, so (negative) INT_MAX is used in the grouping statement?
Upvotes: 0