inconsistent interaction where the "where" clause does not filter out a null value. #149
Replies: 4 comments 1 reply
-
Moving this issue to discussion as it is not about this library but the behavior of the query engine. |
Beta Was this translation helpful? Give feedback.
-
If you were using the count() aggregate instead of arg_max() on an empty table, you would expect to get a single row with count of zero. The summarize operator has to behave the same regardless of the aggregates used. |
Beta Was this translation helpful? Give feedback.
-
I understand that the summarize operator always returns a single row. This is not what my confusion is about. It is about an inconsistency in the where clause. It is about the fact that this row is not filtered by the where clause when it should be filtered. Moreover, if you first calculate the same boolean and then filter on it using the where clause, it is filtered. This is inconsistent. Also, you mentioned that this is not the right place to address this issue. Does anyone know what would be the correct place? |
Beta Was this translation helpful? Give feedback.
-
Thank you @yifatsor ! You're welcome. |
Beta Was this translation helpful? Give feedback.
-
I have an example where an event is not filtered out, when I argue it should be.
Any explanation of why this is normal behaviour would also be amazing. I am confused.
Use-case: Check if there was a new row in the table in the last 2 hours.
To demonstrate, I create an empty table, summarize it based on max
TimeGenerated
.However, if the table is empty,
summarize
still generates an event/row, but it is filled with only NULLs.However, when I then filter for only events from max 2 hours ago, the event with all columns filled with NULLs is still returned!
The documentation of the
where
clause is very clear in that when the column is NULL, these are not returned.I quote from the docs:
In this example, we get an event, with empty (NULL) columns. This is strange to me.
To double check, I did the following: If I first extend the
boolean
condition and then put it in thewhere
clause, it is filtered. This feels arbitrary now.Beta Was this translation helpful? Give feedback.
All reactions