您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關Cloudera流分析中如何引入FlinkSQL,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
SELECT
userId,
COUNT(*) AS count,
SESSION_START(clicktime,
INTERVAL '30' MINUTE)FROM clicks
GROUP BY
SESSION(clicktime, INTERVAL '30' MINUTE)
userId
1) 在流媒體領域中可以用SQL制定多少業務邏輯?
2) 這如何改變從開發到生產的流式作業旅程?
3) 這如何影響數據工程團隊的范圍?
CREATE TABLE ItemTransactions (transactionId BIGINT,`timestamp` BIGINT,itemId STRING, quantity INT, event_time AS CAST(from_unixtime(floor(`timestamp`/1000)) AS TIMESTAMP(3)),WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND) WITH ('connector.type' = 'kafka','connector.version' = 'universal','connector.topic' = 'transaction.log.1','connector.startup-mode' = 'earliest-offset',' connector.properties.bootstrap.servers' = '<broker_address>','format.type' = 'json');
SELECT * FROM ItemTransactions LIMIT 10;SELECT TUMBLE_START(event_time, INTERVAL '10' SECOND) as window_start, itemId, sum(quantity) as volumeFROM ItemTransactionsGROUP BY itemId, TUMBLE(event_time, INTERVAL '10' SECOND);
SELECT * FROM (
SELECT * ,
ROW_NUMBER() OVER (
PARTITION BY window_start
ORDER BY num_transactions desc
) AS rownum
FROM (
SELECT TUMBLE_START(event_time, INTERVAL '10' MINUTE) AS window_start, itemId, COUNT(*) AS num_transactions
FROM ItemTransactions
GROUP BY itemId, TUMBLE(event_time, INTERVAL '10' MINUTE)
)
)
WHERE rownum <=3;
關于Cloudera流分析中如何引入FlinkSQL就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。