From 918c8049dcf9b39d2f4d9422142677e43efbd5f4 Mon Sep 17 00:00:00 2001 From: Sebastien GIRAUD <46746653+giraudseb@users.noreply.github.com> Date: Sun, 9 Feb 2020 17:49:44 +0100 Subject: [PATCH 1/2] Fix path issue when different from this example Update to dynamic path retreival in order to have it working in many much more different contexts --- Bookings/load_airports_airlines.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bookings/load_airports_airlines.sh b/Bookings/load_airports_airlines.sh index d535a5d..07ea6be 100644 --- a/Bookings/load_airports_airlines.sh +++ b/Bookings/load_airports_airlines.sh @@ -3,4 +3,6 @@ SCHEMA_DIR=$(readlink -f ./schema) # use the csv's to load data into the airports and airlines tables -/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/idb_load_data.sql \ No newline at end of file +#/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/idb_load_data.sql +/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -e "LOAD DATA INFILE '${SCHEMA_DIR}/airports.csv' INTO TABLE innodb_schema.airports FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n';" +/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -e "LOAD DATA INFILE '${SCHEMA_DIR}/airlines.csv' INTO TABLE innodb_schema.airlines FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n';" From 2ae4274138ce7fdc5d1312e7504d594a60ea5613 Mon Sep 17 00:00:00 2001 From: Sebastien GIRAUD <46746653+giraudseb@users.noreply.github.com> Date: Sun, 9 Feb 2020 18:03:09 +0100 Subject: [PATCH 2/2] Fix database name from the example Use columnstore_schema as db name instead of flights that doesn't exists --- Bookings/load_flights_data.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bookings/load_flights_data.sh b/Bookings/load_flights_data.sh index eedb3cd..a232d22 100644 --- a/Bookings/load_flights_data.sh +++ b/Bookings/load_flights_data.sh @@ -11,5 +11,5 @@ fi # the advantage of this being runnable as a regular user with a root installation. for f in $DATA_DIR/$filematch.csv; do echo $f - /usr/bin/cpimport -m2 -s ',' -E '"' flights flights -l $f -done \ No newline at end of file + /usr/bin/cpimport -m2 -s ',' -E '"' columnstore_schema flights -l $f +done