antonmks / Alenka

GPU database engine
Other
1.17k stars 120 forks source link

What is the syntax for appending data into a table? #105

Closed marklit closed 8 years ago

marklit commented 8 years ago

Hi,

I've tried to add an append flag to a few locations in my load script but they all return a syntax error. Could you tell me where the APPEND statement should appear please?

Here's my current best guess:

A  :=  LOAD 'trips_xaa.csv' USING (',') AS (
    trip_id{1}:int,
    vendor_id{2}:varchar(3),

    pickup_datetime{3}:varchar(19),

    dropoff_datetime{4}:varchar(19),
    store_and_fwd_flag{5}:varchar(1),
    rate_code_id{6}:int,
    pickup_longitude{7}:DECIMAL(14,2),
    pickup_latitude{8}:DECIMAL(14,2),
    dropoff_longitude{9}:DECIMAL(14,2),
    dropoff_latitude{10}:DECIMAL(14,2),
    passenger_count{11}:int,
    trip_distance{12}:DECIMAL(14,2),
    fare_amount{13}:DECIMAL(14,2),
    extra{14}:DECIMAL(14,2),
    mta_tax{15}:DECIMAL(14,2),
    tip_amount{16}:DECIMAL(14,2),
    tolls_amount{17}:DECIMAL(14,2),
    ehail_fee{18}:DECIMAL(14,2),
    improvement_surcharge{19}:DECIMAL(14,2),
    total_amount{20}:DECIMAL(14,2),
    payment_type{21}:varchar(3),
    trip_type{22}:int,
    pickup{23}:varchar(50),
    dropoff{24}:varchar(50),

    dummy1{25}:varchar(50),
    dummy2{26}:varchar(50),

    cab_type{27}:varchar(6),

    precipitation{28}:int,
    snow_depth{29}:int,
    snowfall{30}:int,
    max_temperature{31}:int,
    min_temperature{32}:int,
    average_wind_speed{33}:int,

    pickup_nyct2010_gid{34}:int,
    pickup_ctlabel{35}:varchar(10),
    pickup_borocode{36}:int,
    pickup_boroname{37}:varchar(13),
    pickup_ct2010{38}:varchar(6) ,
    pickup_boroct2010{39}:varchar(7) ,
    pickup_cdeligibil{40}:varchar(1) ,
    pickup_ntacode{41}:varchar(4) ,
    pickup_ntaname{42}:varchar(56),
    pickup_puma{43}:varchar(4) ,

    dropoff_nyct2010_gid{44}:int,
    dropoff_ctlabel{45}:varchar(10),
    dropoff_borocode{46}:int,
    dropoff_boroname{47}:varchar(13),
    dropoff_ct2010{48}:varchar(6) ,
    dropoff_boroct2010{49}:varchar(7) ,
    dropoff_cdeligibil{50}:varchar(1) ,
    dropoff_ntacode{51}:varchar(4) ,
    dropoff_ntaname{52}:varchar(56),
    dropoff_puma{53}:varchar(4) 
);
STORE A INTO 'trips' BINARY APPEND;

Thanks, Mark

marklit commented 8 years ago

Figured it out, STORE A INTO 'trips' APPEND BINARY;