-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sql
35 lines (29 loc) · 896 Bytes
/
init.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
create external table Account (
AccountID int,
AccountNum varchar(255),
ClientId int,
DateOpen date
) as copy from '/tmp/input/Account.csv' delimiter ';';
create external table Clients(
ClientId int,
ClientName varchar(255),
Type char(2),
Form char(6),
RegisterDate date
) as copy from '/tmp/input/Clients.csv' delimiter ';';
create external table Rate_raw (
Currency char(3),
Rate varchar(10),
RateDate date
) as copy from '/tmp/input/Rate.csv' delimiter ';';
create external table Operation (
AccountDB int,
AccountCR int,
DateOp date,
Amount float,
Currency char(3),
Comment varchar
) as copy from '/tmp/input/Operation.csv' delimiter ';';
create table Rate as select Currency, cast(replace(Rate, ',', '.') as float) as Rate, RateDate from Rate_raw;
--select * from projections;
--select * from storage_containers;