Skip to content
Advertisement

AVG over time Window in Impala … OVER (PARTITION BY … ORDER BY)

I have a Table in Impala in which I have time information as UnixTime with a frequency of 1mSec. I am trying to get the AVG(), MIN() and MAX() for a window of 10Sec (But I do not want to fix it and can be 20sec, 30sec, etc).

I am doing it using sub-queries but I am not getting the right answer. The following is my Data in a Table: Data in the Table

I am using the following sub-query to get the AVG(), MIN() and MAX() for a window of 10 seconds. I am using OVER (PARTITION BY … ORDER BY) but not getting the correct results. My query is as follow:

I need the following answer:

Could anybody tell me that what is wrong in my Impala Query.

Thanks !!!

Advertisement

Answer

I think you just want aggregation, not window functions:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement