Dose mapd support bulk import data?


#1

i have 20 files to import to mapd,the "copy from " clause only import one file for one time.so i have to do the “copy from” 20 times.
any way to bulk import data to mapd?
thx


#2

do you mean a copy command with a wildcard or something different? it’s quite easy to reproduce with a small shell script like this

for i in $(ls -1 /opt/mapd/opendata/fatture_test_201*); do
echo copy table_name from ‘$1’ >>tmpfile.txt
done;
mapdql -u mapd -p password <tmpfile.txt
rm tmpfile.txt

there is also a steamloader but i havent tried yet


#3

The COPY FROM statement also supports globbing.

Equivalent of aznable’s example:

COPY table_name FROM '/opt/mapd/opendata/fatture_test_201*';

#4

i solved my problem with your tips,thx.