-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathcreate_fix_tables.sql
72 lines (68 loc) · 1.44 KB
/
create_fix_tables.sql
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
DROP TABLE IF EXISTS fix_messagetypes;
CREATE TABLE fix_messagetypes
(
msgtype STRING
, msgtypedesc STRING
, PRIMARY KEY (msgtype)
)
PARTITION BY HASH(msgtype) PARTITIONS 2
STORED AS KUDU;
INSERT INTO fix_messagetypes VALUES ('D', 'Order Single'), ('8', 'Execution Report');
DROP TABLE IF EXISTS fix_newordersingle;
CREATE TABLE fix_newordersingle
(
clordid STRING
, msgtype STRING
, msgtypedesc STRING
, handlinst INT
, `symbol` STRING
, side INT
, transacttime BIGINT
, ordtype INT
, orderqty INT
, checksum STRING
, PRIMARY KEY (clordid)
)
PARTITION BY HASH(clordid) PARTITIONS 4
STORED AS KUDU;
DROP TABLE IF EXISTS fix_execrpt;
CREATE TABLE fix_execrpt
(
execid STRING
, msgtype STRING
, msgtypedesc STRING
, orderid STRING
, clordid STRING
, exectranstype INT
, exectype INT
, ordstatus INT
, `symbol` STRING
, side INT
, leavesqty INT
, cumqty INT
, avgpx DOUBLE
, transacttime BIGINT
, checksum STRING
, lastupdated STRING
, PRIMARY KEY (execid)
)
PARTITION BY HASH(execid) PARTITIONS 4
STORED AS KUDU;
DROP TABLE IF EXISTS fix_orderhistory;
CREATE TABLE fix_orderhistory
(
clordid STRING
, startdate BIGINT
, `symbol` STRING
, transacttime BIGINT
, orderqty INT
, leavesqty INT
, cumqty INT
, avgpx DOUBLE
, enddate BIGINT
, currentflag STRING
, lastupdated STRING
, PRIMARY KEY (clordid, startdate)
)
PARTITION BY HASH(clordid, startdate) PARTITIONS 4
STORED AS KUDU;