Revision 6650
Added by Aaron Marcuse-Kubitza about 12 years ago
bin/publish_analytical_db | ||
---|---|---|
1 | 1 |
#!/bin/sh |
2 | 2 |
# Publishes analytical DB to nimoy |
3 |
# Usage: self analytical_aggregate.csv |
|
4 | 3 |
|
4 |
if ! test -n "$test" -a "$#" -eq 1; then |
|
5 |
echo "Usage: env table=... $0 export.csv"|fold -s >&2 |
|
6 |
exit 2 |
|
7 |
fi |
|
8 |
|
|
5 | 9 |
mysql --password --database=bien3_adb <<EOF |
6 | 10 |
LOAD DATA LOCAL INFILE '$1' |
7 |
INTO TABLE analytical_aggregate
|
|
11 |
INTO TABLE $table
|
|
8 | 12 |
FIELDS TERMINATED BY ',' |
9 | 13 |
OPTIONALLY ENCLOSED BY '"' |
10 | 14 |
ESCAPED BY '"' |
README.TXT | ||
---|---|---|
56 | 56 |
Rename any existing analytical_aggregate table |
57 | 57 |
Create the analytical_aggregate table using its schema in |
58 | 58 |
schemas/vegbien.my.sql |
59 |
bin/publish_analytical_db backups/analytical_aggregate.public.<version>.csv |
|
59 |
env table=analytical_aggregate_r<revision> bin/publish_analytical_db \ |
|
60 |
backups/analytical_aggregate.public.<version>.csv |
|
60 | 61 |
If desired, record the import times in inputs/import.stats.xls: |
61 | 62 |
Open inputs/import.stats.xls |
62 | 63 |
Insert a copy of the leftmost Column-based column group before it |
Also available in: Unified diff
publish_analytical_db: Require caller to specify the name of the table to load data into. This allows appending a revision to analytical_aggregate, or publishing a table other than analytical_aggregate.