什麼
|
怎麼樣
|
---|---|
EPL
|
首先,編譯和部署語句,請參閱
第5章,
EPL參考:子句
,
第15章,
編譯器參考
和
第16章,
運行時參考
。
|
回調
|
其次,附加應用程序提供的可執行代碼以接收輸出,請參閱
表16.2「接收語句結果的選擇」
。
|
活動
|
接下來,使用運行時API發送事件,請參見
第16.6節「使用EPEventService處理事件和時間」
。
|
時間
|
接下來,使用運行時API或系統時間的提早時間,請參見
第16.9節「控制時間保持」
。
|
Withdrawal
account
amount
Withdrawal
從提款中選擇*複製代碼
Withdrawal
Withdrawal
W
Withdrawal
從提款中選擇計數(*),總和(金額)複製代碼
Withdrawal
amount
BigDecimal
Withdrawal
Withdrawal
select * from Withdrawal(金額> = 200)複製代碼
Withdrawal
Withdrawal
Withdrawal
從提款中選擇計數(*),總和(金額)(金額> = 200)複製代碼
Withdrawal
Withdrawal
Withdrawal
select * from Withdrawal #length(5)複製代碼
Withdrawal
Withdrawal
從提款中選擇計數(*),總和(金額)#長度(5)複製代碼
Withdrawal
Withdrawal
1000 + 300 - 500
irstream
Withdrawal
Withdrawal
從提款中選擇計數(*),總和(金額)(金額> = 200)#length(5)複製代碼
Withdrawal
Withdrawal
....
選擇....從提款(金額> 200)
// 至關於
選擇....從提款金額> 200複製代碼
select * from Withdrawal#length(5)其中amount> = 200複製代碼
Withdrawal
選擇計數(*),總和(金額)做爲提取的總數#time(4)複製代碼
t
t + 4
t + 5 seconds
t + 4 seconds
W1
t + 5 seconds
W2
t + 6.5 seconds
W3
t + 8 seconds
W1
Withdrawal
建立上下文Batch4Seconds在4秒後開始@now結束複製代碼
Withdrawal
t
t+4
t+8
context Batch4Seconds從提取中選擇count(*),total(amount)複製代碼
t + 4 seconds
t + 8 seconds
Withdrawal
每4秒從提取輸出中選擇計數(*),總數(金額)複製代碼
t + 4 seconds
t + 8 seconds
Withdrawal
建立上下文Batch4Seconds在4秒後開始@now結束複製代碼
context Batch4Seconds選擇count(*),從終止時的提取輸出中獲取的總數(金額)複製代碼
t + 4 seconds
t + 8 seconds
from
建立窗口取款窗口#time(10)做爲提款複製代碼
WithdrawalWindow
Withdrawal
#time(10) as Withdrawal
Withdrawal
on Withdrawal merge WithdrawalWindow insert select *複製代碼
Withdrawal
WithdrawalWindow
Withdrawal
從WithdrawalWindow中選擇avg(amount)做爲avgAmount複製代碼
count
sum
count
sum
count
sum
Withdrawal
0001
5000
on Withdrawal merge WithdrawalWindow insert select *
count
sum
5000
avgAmount
5000
Withdrawal
0001
5000
count
sum
null
count
avgAmount
null
window
sorted
create table AccountAverages(賬戶字符串主鍵,avgAmount avg(double))複製代碼
string
double
create table
double
0001
0002
avgAmount
count
sum
0001
count
sum
null
進入表AccountAverages
選擇avg(amount)做爲avgAmount
來自退出#time(10)
按賬戶分組複製代碼
into table
AccountAverages
as avgAmount
avgAmount
group by
Withdrawal
Withdrawal
0001
5000
avgAmount
count
sum
count
sum
5000
Withdrawal
0001
5000
avgAmount
count
sum
null
count
from
BankInformationWindow
select * from Withdrawal unidirectional,BankInformationWindow複製代碼
Withdrawal
BankInformationWindow
選擇金額(金額)
來自提取單向,BankInformationWindow複製代碼
Withdrawal
group_by
sum(amount, group_by:account)
選擇賬戶,總和(金額)
來自提取單向,BankInformationWindow複製代碼
Withdrawal
BankInformationWindow
select
group by
選擇賬戶,總和(金額)
來自提取單向,BankInformationWindow
按賬戶分組複製代碼
Withdrawal
group_by
group by
sum(amount, group_by:accountCategory)
group by
選擇賬戶,賬戶名,總和(金額)
來自提取單向,BankInformationWindow
按賬戶分組複製代碼
Withdrawal
BankInformationWindow
從AlertNamedWindow中選擇*
match_recognize(
按來源劃分
測量a1.origin爲原點,a1.alarmNumber爲alarmNumber1,a2.alarmNumber爲alarmNumber2
模式(a1 a2)
限定
a1 as a1.priority ='high',
a2 as a2.priority ='medium'
)複製代碼
每一個StockTickEvent(符號=「IBM」,價格> 80)其中計時器:在(60秒)內複製代碼
每一個計時器:at(5,*,*,*,*)複製代碼
A - >(B或C)複製代碼
每一個a = EventX - >每一個b = EventY(objectID = a.objectID)複製代碼
symbol=「google」 and price > 200 and volume > 111000
from
from
from
from
from
where
WithdrawalEvent
account
@name('A')select * from WithdrawalEvent(account = 1)複製代碼
@name('B')從WithdrawalEvent(account = 1)中選擇*複製代碼
@name('C')從WithdrawalEvent(account = 2)中選擇*複製代碼
WithdrawalEvent
account
WithdrawalEvent
account
Withdrawal
account
account
WithdrawalEvent
WithdrawalEvent
account
@name('P')select * from pattern [every w1 = WithdrawalEvent - > w2 = WithdrawalEvent(account = w.account)]複製代碼
WithdrawalEvent
WithdrawalEvent
WithdrawalEvent
WithdrawalEvent
WithdrawalEvent
WithdrawalEvent
WithdrawalEvent
Withdrawal
account
LoginEvent
account
LoginEvent
@name('A')建立由LoginEvent做爲loginEvent啓動的上下文UserSession複製代碼
LoginEvent
@name('B')上下文UserSession從WithdrawalEvent中選擇count(*)(account = context.loginEvent.account)複製代碼
LoginEvent
LoginEvent
WithdrawalEvent
LoginEvent
WithdrawalEvent
LoginEvent
WithdrawalEvent
Withdrawal
account
where-
on-
create index
true
false
null
null
true
false
null
null
true
false
null
null = 1複製代碼
null <> 1複製代碼
null> 1複製代碼
null = null複製代碼
null
null
null
is null