I am trying to import data from a CSV file (latlong.csv) and I want to remove all of the quotes from my columns. Please Refer to first image.
This is the code I used to import the data
CREATE TABLE IF NOT EXISTS latlong
(COUNTRY String, ALPHA2 String, ALPHA3 String, NUMERICCODE String,
LATITUDE String, LONGITUDE String)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
tblproperties("skip.header.line.count"="1");
LOAD DATA LOCAL INPATH '/tmp/project2/latlong.csv' INTO TABLE latlong;
I tried to use the command below but I get an error. Error saying I can only insert into the table and not update it (i think).
Update latlong set country = replace(country, '"', '')