Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
92d723d6
Commit
92d723d6
authored
Apr 24, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docker: remove downloaded temp files from opendata image
parent
9e0acdda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
docker/blocks/mysql_opendata/Dockerfile
+2
-1
docker/blocks/mysql_opendata/import_csv.sql
+14
-12
No files found.
docker/blocks/mysql_opendata/Dockerfile
View file @
92d723d6
...
@@ -12,7 +12,8 @@ RUN apt-get update && apt-get install -y wget && apt-get install unzip
...
@@ -12,7 +12,8 @@ RUN apt-get update && apt-get install -y wget && apt-get install unzip
# Fetch NYC Data Set
# Fetch NYC Data Set
RUN
wget https://data.cityofnewyork.us/download/57g5-etyj/application%2Fzip
-O
/tmp/data.zip
&&
\
RUN
wget https://data.cityofnewyork.us/download/57g5-etyj/application%2Fzip
-O
/tmp/data.zip
&&
\
unzip
-j
/tmp/data.zip 311_Service_Requests_from_2015.csv
-d
/var/lib/mysql-files
unzip
-j
/tmp/data.zip 311_Service_Requests_from_2015.csv
-d
/var/lib/mysql-files
&&
\
rm /tmp/data.zip
ADD
import_csv.sql /docker-entrypoint-initdb.d/
ADD
import_csv.sql /docker-entrypoint-initdb.d/
...
...
docker/blocks/mysql_opendata/import_csv.sql
View file @
92d723d6
...
@@ -56,23 +56,25 @@ CREATE TABLE IF NOT EXISTS `nyc_open_data` (
...
@@ -56,23 +56,25 @@ CREATE TABLE IF NOT EXISTS `nyc_open_data` (
Location
varchar
(
255
)
Location
varchar
(
255
)
);
);
LOAD
DATA
INFILE
'/var/lib/mysql-files/311_Service_Requests_from_2015.csv'
INTO
TABLE
nyc_open_data
FIELDS
OPTIONALLY
ENCLOSED
BY
'"'
TERMINATED
BY
','
IGNORE
1
LINES
;
LOAD
DATA
INFILE
'/var/lib/mysql-files/311_Service_Requests_from_2015.csv'
INTO
TABLE
nyc_open_data
FIELDS
OPTIONALLY
ENCLOSED
BY
'"'
TERMINATED
BY
','
IGNORE
1
LINES
;
update
nyc_open_data
set
CreatedDate
=
STR_TO_DATE
(
CreatedDate
,
'%m/%d/%Y %r'
)
where
CreatedDate
<>
''
;
UPDATE
nyc_open_data
SET
CreatedDate
=
STR_TO_DATE
(
CreatedDate
,
'%m/%d/%Y %r'
)
WHERE
CreatedDate
<>
''
;
update
nyc_open_data
set
ClosedDate
=
STR_TO_DATE
(
ClosedDate
,
'%m/%d/%Y %r'
)
where
ClosedDate
<>
''
;
UPDATE
nyc_open_data
SET
ClosedDate
=
STR_TO_DATE
(
ClosedDate
,
'%m/%d/%Y %r'
)
WHERE
ClosedDate
<>
''
;
update
nyc_open_data
set
DueDate
=
STR_TO_DATE
(
DueDate
,
'%m/%d/%Y %r'
)
where
DueDate
<>
''
;
UPDATE
nyc_open_data
SET
DueDate
=
STR_TO_DATE
(
DueDate
,
'%m/%d/%Y %r'
)
WHERE
DueDate
<>
''
;
update
nyc_open_data
set
ResolutionActionUpdatedDate
=
STR_TO_DATE
(
ResolutionActionUpdatedDate
,
'%m/%d/%Y %r'
)
where
ResolutionActionUpdatedDate
<>
''
;
UPDATE
nyc_open_data
SET
ResolutionActionUpdatedDate
=
STR_TO_DATE
(
ResolutionActionUpdatedDate
,
'%m/%d/%Y %r'
)
WHERE
ResolutionActionUpdatedDate
<>
''
;
update
nyc_open_data
set
CreatedDate
=
null
where
CreatedDate
=
''
;
UPDATE
nyc_open_data
SET
CreatedDate
=
null
WHERE
CreatedDate
=
''
;
update
nyc_open_data
set
ClosedDate
=
null
where
ClosedDate
=
''
;
UPDATE
nyc_open_data
SET
ClosedDate
=
null
WHERE
ClosedDate
=
''
;
update
nyc_open_data
set
DueDate
=
null
where
DueDate
=
''
;
UPDATE
nyc_open_data
SET
DueDate
=
null
WHERE
DueDate
=
''
;
update
nyc_open_data
set
ResolutionActionUpdatedDate
=
null
where
ResolutionActionUpdatedDate
=
''
;
UPDATE
nyc_open_data
SET
ResolutionActionUpdatedDate
=
null
WHERE
ResolutionActionUpdatedDate
=
''
;
alter
table
nyc_open_data
modify
CreatedDate
datetime
null
;
ALTER
TABLE
nyc_open_data
modify
CreatedDate
datetime
NULL
;
alter
table
nyc_open_data
modify
ClosedDate
datetime
null
;
ALTER
TABLE
nyc_open_data
modify
ClosedDate
datetime
NULL
;
alter
table
nyc_open_data
modify
DueDate
datetime
null
;
ALTER
TABLE
nyc_open_data
modify
DueDate
datetime
NULL
;
alter
table
nyc_open_data
modify
ResolutionActionUpdatedDate
datetime
null
;
ALTER
TABLE
nyc_open_data
modify
ResolutionActionUpdatedDate
datetime
NULL
;
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_ComplaintType`
(
`ComplaintType`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_ComplaintType`
(
`ComplaintType`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_CreatedDate`
(
`CreatedDate`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_CreatedDate`
(
`CreatedDate`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_LocationType`
(
`LocationType`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_LocationType`
(
`LocationType`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_AgencyName`
(
`AgencyName`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_AgencyName`
(
`AgencyName`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_City`
(
`City`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_City`
(
`City`
);
SYSTEM
rm
/
var
/
lib
/
mysql
-
files
/
311
_Service_Requests_from_2015
.
csv
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment