-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_hana_parcel_capacity_indicators
82 lines (75 loc) · 1.91 KB
/
import_hana_parcel_capacity_indicators
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
create database v2050_parcel_capacity;
create table v2050_parcel_capacity.capacity_indicator_parcel_20180911
(
parcel_id integer not null
,du_base float not null
,du_capacity float not null
,nonres_sqfeet_base float not null
,nonres_sqfeet_capacity float not null
,jobs_base float not null
,jobs_capacity float not null
,bldg_sqfeet_base float not null
,bldg_sqfeet_capacity float not null
,primary key (parcel_id)
);
LOAD DATA LOCAL INFILE 'J:/Projects/V2050/SEIS/Data_Support/script_input/CapacityIndicatorPcl_res50.csv'
INTO TABLE v2050_parcel_capacity.capacity_indicator_parcel_20180911
FIELDS TERMINATED BY ','
#ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(
parcel_id
,du_base
,du_capacity
,nonres_sqfeet_base
,nonres_sqfeet_capacity
,jobs_base
,jobs_capacity
,bldg_sqfeet_base
,bldg_sqfeet_capacity
);
create table v2050_parcel_capacity.parcels_geos_20180911
(
parcel_id integer not null
,growth_center_id integer not null
,faz_id integer not null
,city_id integer not null
,county_id integer not null
,tod_id integer not null
,zone_id integer not null
,plan_type_id integer not null
,census_tract_id integer not null
,primary key (parcel_id)
);
LOAD DATA LOCAL INFILE 'J:/Projects/V2050/SEIS/Data_Support/script_input/parcels_geos.csv'
INTO TABLE v2050_parcel_capacity.parcels_geos_20180911
FIELDS TERMINATED BY ','
#ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(
parcel_id
,growth_center_id
,faz_id
,city_id
,county_id
,tod_id
,zone_id
,plan_type_id
,census_tract_id
);
select
city_id
,sum(du_base)
,sum(du_capacity)
,sum(nonres_sqfeet_base)
,sum(nonres_sqfeet_capacity)
,sum(jobs_base)
,sum(jobs_capacity)
,sum(bldg_sqfeet_base)
,sum(bldg_sqfeet_capacity)
from v2050_parcel_capacity.capacity_indicator_parcel_20180911
inner join v2050_parcel_capacity.parcels_geos_20180911
on v2050_parcel_capacity.capacity_indicator_parcel_20180911.parcel_id = v2050_parcel_capacity.parcels_geos_20180911.parcel_id
group by city_id;