-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKDA_studio.sql
More file actions
26 lines (24 loc) · 849 Bytes
/
KDA_studio.sql
File metadata and controls
26 lines (24 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%flink.ssql(type=update)
DROP TABLE IF EXISTS stock_table;
-- create a table to glue data catalog table with columns for stock data,
-- sets a watermark to trigger late arrival events, and configures it to read
-- from a Kinesis stream, in JSON format with an ISO-8601 timestamp format.
CREATE TABLE stock_table(
`date` STRING,
ticker VARCHAR(6),
open_price FLOAT,
high FLOAT,
low FLOAT,
close_price FLOAT,
adjclose FLOAT,
volume BIGINT,
event_time TIMESTAMP(3),
WATERMARK FOR event_time as event_time - INTERVAL '5' SECOND
) WITH ( --connect to your kinesis data stream
'connector' = 'kinesis',
'stream' = 'mp11v2_ds',
'aws.region' = 'us-east-1',
'scan.stream.initpos' = 'TRIM_HORIZON',
'format' = 'json',
'json.timestamp-format.standard' = 'ISO-8601'
);