Question

I have a very basic Esper question,what is the basic difference between OUTPUT WHEN and WHERE key word in Esper. Here is an example where i am using these Key Words.

select
  high
from 
  Bar
where
  getDirection() != Direction.FLAT;

and

select
  high
from 
  Bar
output when
  getDirection() != Direction.FLAT;
Was it helpful?

Solution

"output when" batches up output until the condition turns true.

Always prefer filters over where-clauses: select high from Bar (direction != Direction.FLAT)

OTHER TIPS

select high from Bar where getDirection() != Direction.FLAT; --> This statement will returns all you value in which getDirection()!= Direction.FLAT. It is something like you are comparing the values of that table with external values.

select high from Bar when getDirection() != Direction.FLAT; --> This statement returns all the values from Bar when your getDirection() != Direction.FLAT It is like you are fetching the values when certain condition is true.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top