-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathload_tvdt_test_data.sql
143 lines (134 loc) · 5.01 KB
/
load_tvdt_test_data.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
DROP USER IF EXISTS "TABLEAU_TEST_USER" CASCADE;
CREATE USER "TABLEAU_TEST_USER" IDENTIFIED BY "TABLEAU_TEST_PASSWORD";
GRANT CREATE SESSION TO "TABLEAU_TEST_USER";
DROP SCHEMA IF EXISTS "TESTV1" CASCADE;
CREATE SCHEMA "TESTV1";
ALTER SCHEMA "TESTV1" CHANGE OWNER "TABLEAU_TEST_USER";
OPEN SCHEMA "TESTV1";
-- The following DLL scripts in this setup script are taken from the Tableau test
-- datasets, published on GitHub by Tableau under the MIT license.
-- https://github.com/tableau/connector-plugin-sdk/tree/master/tests/datasets/TestV1
CREATE TABLE "Batters"
(
"Player" VARCHAR(101),
"Team" VARCHAR(50),
"League" VARCHAR(2),
"Year" SMALLINT,
"Games" DOUBLE PRECISION,
"AB" DOUBLE PRECISION,
"R" DOUBLE PRECISION,
"H" DOUBLE PRECISION,
"Doubles" DOUBLE PRECISION,
"Triples" DOUBLE PRECISION,
"HR" DOUBLE PRECISION,
"RBI" DOUBLE PRECISION,
"SB" DOUBLE PRECISION,
"CS" DOUBLE PRECISION,
"BB" DOUBLE PRECISION,
"SO" DOUBLE PRECISION,
"IBB" DOUBLE PRECISION,
"HBP" DOUBLE PRECISION,
"SH" DOUBLE PRECISION,
"SF" DOUBLE PRECISION,
"GIDP" DOUBLE PRECISION
);
CREATE TABLE "Calcs"
(
"key" VARCHAR(255),
"num0" DOUBLE PRECISION,
"num1" DOUBLE PRECISION,
"num2" DOUBLE PRECISION,
"num3" DOUBLE PRECISION,
"num4" DOUBLE PRECISION,
"str0" VARCHAR(255),
"str1" VARCHAR(255),
"str2" VARCHAR(255),
"str3" VARCHAR(255),
"int0" INTEGER,
"int1" INTEGER,
"int2" INTEGER,
"int3" INTEGER,
"bool0" BOOLEAN,
"bool1" BOOLEAN,
"bool2" BOOLEAN,
"bool3" BOOLEAN,
"date0" DATE,
"date1" DATE,
"date2" DATE,
"date3" DATE,
"time0" TIMESTAMP,
"time1" VARCHAR(20), -- originally type TIME, but not supported by EXASOL
"datetime0" TIMESTAMP,
"datetime1" VARCHAR(255),
"zzz" VARCHAR(255)
);
CREATE TABLE "Staples"
(
"Item Count" INTEGER NOT NULL,
"Ship Priority" VARCHAR(14) NOT NULL,
"Order Priority" VARCHAR(15) NOT NULL,
"Order Status" VARCHAR(13) NOT NULL,
"Order Quantity" DOUBLE PRECISION NOT NULL,
"Sales Total" DOUBLE PRECISION NOT NULL,
"Discount" DOUBLE PRECISION NOT NULL,
"Tax Rate" DOUBLE PRECISION NOT NULL,
"Ship Mode" VARCHAR(25) NOT NULL,
"Fill Time" DOUBLE PRECISION NOT NULL,
"Gross Profit" DOUBLE PRECISION NOT NULL,
"Price" NUMERIC(18,4) NOT NULL,
"Ship Handle Cost" NUMERIC(18,4) NOT NULL,
"Employee Name" VARCHAR(50) NOT NULL,
"Employee Dept" VARCHAR(4) NOT NULL,
"Manager Name" VARCHAR(255) NOT NULL,
"Employee Yrs Exp" DOUBLE PRECISION NOT NULL,
"Employee Salary" NUMERIC(18,4) NOT NULL,
"Customer Name" VARCHAR(50) NOT NULL,
"Customer State" VARCHAR(50) NOT NULL,
"Call Center Region" VARCHAR(25) NOT NULL,
"Customer Balance" DOUBLE PRECISION NOT NULL,
"Customer Segment" VARCHAR(25) NOT NULL,
"Prod Type1" VARCHAR(50) NOT NULL,
"Prod Type2" VARCHAR(50) NOT NULL,
"Prod Type3" VARCHAR(50) NOT NULL,
"Prod Type4" VARCHAR(50) NOT NULL,
"Product Name" VARCHAR(100) NOT NULL,
"Product Container" VARCHAR(25) NOT NULL,
"Ship Promo" VARCHAR(25) NOT NULL,
"Supplier Name" VARCHAR(25) NOT NULL,
"Supplier Balance" DOUBLE PRECISION NOT NULL,
"Supplier Region" VARCHAR(25) NOT NULL,
"Supplier State" VARCHAR(50) NOT NULL,
"Order ID" VARCHAR(10) NOT NULL,
"Order Year" INTEGER NOT NULL,
"Order Month" INTEGER NOT NULL,
"Order Day" INTEGER NOT NULL,
"Order Date" TIMESTAMP NOT NULL,
"Order Quarter" VARCHAR(2) NOT NULL,
"Product Base Margin" DOUBLE PRECISION NOT NULL,
"Product ID" VARCHAR(5) NOT NULL,
"Receive Time" DOUBLE PRECISION NOT NULL,
"Received Date" TIMESTAMP NOT NULL,
"Ship Date" TIMESTAMP NOT NULL,
"Ship Charge" NUMERIC(18,4) NOT NULL,
"Total Cycle Time" DOUBLE PRECISION NOT NULL,
"Product In Stock" VARCHAR(3) NOT NULL,
"PID" INTEGER NOT NULL,
"Market Segment" VARCHAR(25) NOT NULL
);
--- The following statements import the CSV test data provided by Tableau on
--- GitHub. Also under MIT license.
IMPORT INTO "Batters"
FROM CSV
AT 'https://github.com/tableau/connector-plugin-sdk/blob/master/tests/datasets/TestV1/'
FILE 'Batters.csv?raw=true'
NULL = 'NULL';
IMPORT INTO "Calcs"
FROM CSV
AT 'https://github.com/tableau/connector-plugin-sdk/blob/master/tests/datasets/TestV1/'
FILE 'Calcs.csv?raw=true'
NULL = 'NULL';
IMPORT INTO "Staples"
FROM CSV
AT 'https://github.com/tableau/connector-plugin-sdk/blob/master/tests/datasets/TestV1/'
FILE 'Staples_utf8.csv?raw=true'
NULL = 'NULL';