Skip to content

Instantly share code, notes, and snippets.

@philipz
Last active January 2, 2021 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipz/d7fc3fb62b5f9f1afa1ddab0f474b2ce to your computer and use it in GitHub Desktop.
Save philipz/d7fc3fb62b5f9f1afa1ddab0f474b2ce to your computer and use it in GitHub Desktop.
TiDB OnTime Dataset loading

Ref: Could you provide an example to load big dataset like Percona?

# SET GLOBAL sql_mode = ''
for y in `seq 1987 2018`
do
for i in `seq 1 12`
do
echo "$y - $i"
mysql --local-infile=1 -h 127.0.0.1 -P 4000  -u root -e "load data local infile '/home/philipz/otp/On_Time_On_Time_Performance_${y}_${i}.csv' into table otp.ontime fields terminated by ',' OPTIONALLY ENCLOSED BY '\"' ignore 1 lines"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment