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
253b8be4
Commit
253b8be4
authored
Apr 23, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysql: updated test data
parent
fdc68a8b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
docker/blocks/mysql_opendata/Dockerfile
+2
-2
docker/blocks/mysql_opendata/fig
+1
-1
docker/blocks/mysql_opendata/import_csv.sql
+7
-1
No files found.
docker/blocks/mysql_opendata/Dockerfile
View file @
253b8be4
...
...
@@ -11,8 +11,8 @@ ENV MYSQL_DATABASE="testdata" \
RUN
apt-get update
&&
apt-get install
-y
wget
&&
apt-get install unzip
# Fetch NYC Data Set
RUN
wget https://data.cityofnewyork.us/download/
fpz8-jqf4
/application%2Fzip
-O
/tmp/data.zip
&&
\
unzip
-j
/tmp/data.zip 311_Service_Requests_from_201
1
.csv
-d
/var/lib/mysql-files
RUN
wget https://data.cityofnewyork.us/download/
57g5-etyj
/application%2Fzip
-O
/tmp/data.zip
&&
\
unzip
-j
/tmp/data.zip 311_Service_Requests_from_201
5
.csv
-d
/var/lib/mysql-files
ADD
import_csv.sql /docker-entrypoint-initdb.d/
...
...
docker/blocks/mysql_opendata/fig
View file @
253b8be4
...
...
@@ -6,4 +6,4 @@ mysql_opendata:
MYSQL_USER: grafana
MYSQL_PASSWORD: password
ports:
- "330
6
:3306"
- "330
7
:3306"
docker/blocks/mysql_opendata/import_csv.sql
View file @
253b8be4
...
...
@@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS `nyc_open_data` (
Longitude
varchar
(
255
),
Location
varchar
(
255
)
);
LOAD
DATA
INFILE
'/var/lib/mysql-files/311_Service_Requests_from_201
1
.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_201
5
.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
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
<>
''
;
...
...
@@ -70,3 +70,9 @@ alter table nyc_open_data modify CreatedDate 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
ResolutionActionUpdatedDate
datetime
null
;
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_LocationType`
(
`LocationType`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_AgencyName`
(
`AgencyName`
);
ALTER
TABLE
`nyc_open_data`
ADD
INDEX
`IX_City`
(
`City`
);
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