https://pinot.apache.org/ logo
n

Nick Bowles

02/24/2021, 6:27 PM
Running a query and I get different results for one field each time I run it. Any explanation for why this might happen?
Copy code
SELECT id, week(fromDateTime(datefield, 'yyyy-MM-dd')) as week, SUM(f1 * f2 * f3) AS "ftotal" ****THIS IS THE FIELD THAT RETURNS DIFFERENT RESULTS****
FROM mytable
WHERE year(fromDateTime(datefield, 'yyyy-MM-dd')) >= cast(year(now())-2 as long)
  AND id in (123, 1234, 12345) AND f4 = 'blah' AND f5 in ('1-2', '3-4') AND f6 in ('foo', 'bar')
GROUP BY 1, 2
j

Jackie

02/24/2021, 6:32 PM
Different result for the same group or it returns different groups?
n

Nick Bowles

02/24/2021, 6:48 PM
Actually you’re right, it is returning different groups based off the second column. It looks like it is limiting the results to 10 (I am using the query console) but I don’t have a limit in my query
maybe the console limits it to 10 by default?
j

Jackie

02/24/2021, 7:09 PM
Yes, the limit is 10 by default if not specified
n

Nick Bowles

02/24/2021, 7:09 PM
whoops, PEBKAC haha. Thanks Jackie!