1.新建一個.csv的文件。sql
①打開目錄mapd-core下的insert_sample_data,最下面有這句話:copy $table from '${csv}' with (quoted='true');數據庫
②在運行insert_sample_data後,下載的文件被放在了/mapd-core/build/sample_datasets,ui
打開/mapd-core/build/sample_datasets/flights_2008_10k中的flights_2008_10k.sql。code
能夠看到生成table的代碼:ci
drop table if exists flights_2008_10k;it
create table flights_2008_10k ( flight_year smallint, flight_month smallint, flight_dayofmonth smallint, flight_dayofweek smallint, deptime smallint, crsdeptime smallint, arrtime smallint, crsarrtime smallint, uniquecarrier text encoding dict, flightnum smallint, tailnum text encoding dict, actualelapsedtime smallint, crselapsedtime smallint, airtime smallint, arrdelay smallint, depdelay smallint, origin text encoding dict, dest text encoding dict, distance smallint, taxiin smallint, taxiout smallint, cancelled smallint, cancellationcode text encoding dict, diverted smallint, carrierdelay smallint, weatherdelay smallint, nasdelay smallint, securitydelay smallint, lateaircraftdelay smallint, dep_timestamp timestamp(0), arr_timestamp timestamp(0), carrier_name text encoding dict, plane_type text encoding dict, plane_manufacturer text encoding dict, plane_issue_date date, plane_model text encoding dict, plane_status text encoding dict, plane_aircraft_type text encoding dict, plane_engine_type text encoding dict, plane_year smallint, origin_name text encoding dict, origin_city text encoding dict, origin_state text encoding dict, origin_country text encoding dict, origin_lat real, origin_lon real, dest_name text encoding dict, dest_city text encoding dict, dest_state text encoding dict, dest_country text encoding dict, dest_lat real, dest_lon real, origin_merc_x real, origin_merc_y real, dest_merc_x real, dest_merc_y real ) with (fragment_size = 2000000);io
以上能夠看出所給表的結構。table
③該文件夾中有包含10k數據的.csv。test
④把表格拷出來:在/mapd-core/build/sample_datasets中mkdir flights_2008_new。 而後拷出來 cp flights_2008_10k.csv /mapd-core/build/sample_datasets/flights_2008_new 。更名:mv flights_2008_10k.csv flights_2008_new.csvsed
⑤在mapdql中,\timing計時。 COPY (SELECT * FROM flights_2008_10k) TO '/mapd-core/build/sample_datasets/flights_2008_new/flights_2008_new.csv';
2。在mapdql中建表flights_2008_test。
copy flights_2008_test from '/mapd-core/build/sample_datasets/flights_2008_new/flights_2008_new.csv' with (quoted='true');
重複以上的過程能夠一直擴容。
若是須要大的數據庫,能夠用所給的7M數據庫擴:
copy flights_2008_test from '/mapd-core/build/sample_datasets/flights_2008_7M/flights_2008_7M.csv' with (quoted='true');