Null
Provides examples on using nulls in Siddhi Apps.
For more information refer Siddhi query guide.
define stream ProductInputStream (item string, price double);
define Table ProductInfoTable (item string, discount double);
@info(name = 'Check-for-null')
from ProductInputStream [not(item is null)]
select item,
price is null as isPriceNull
insert into ProductValidationStream;
@info(name = 'Outer-join-with-table')
from ProductInputStream as s
left outer join ProductInfoTable as t
on s.item == t.item
select s.item, s.price, t.discount,
math:power(t.discount, 2) is null
as isFunctionReturnsNull,
t is null as isTNull,
s is null as isSNull,
t.discount is null as isTDiscountNull,
s.item is null as isSItemNull
insert into DiscountValidationStream;
|
|
|
Empty |
|
|
|
Filter events with |
|
|
|
Checks if |
|
|
|
|
|
Check if |
|
Check if streams |
|
Check if streams attributes |
|
Input
Below event is sent to ProductInputStream
,
['Cake'
, 12.0
]
Output
After processing, the following events will be arriving at each stream:
- ProductValidationStream:
[Cake
,false
] - DiscountValidationStream:
[Cake
,12.0
,null
,true
,true
,false
,true
,false
]