Login  Register

Unable to load CSV using differenent delimiter like "|"(Pipe) and ";" (Semicolon) etc

Posted by Harmeet on Oct 21, 2016; 6:23am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/Unable-to-load-CSV-using-differenent-delimiter-like-Pipe-and-Semicolon-etc-tp2140.html

Hey Team,

I am trying to load data from csv using different delimiters like "|"(Pipe) and ";" (Semicolon) etc. But the system gave me an different errors according to delimiter. The example as below:

create table one (name string, description string, salary double, age int, dob timestamp) stored by 'carbondata';

1. "|" (Pipe Delimeter)

deliandquote.csv File >>

name, description, salary, age, dob
tammy| 'my name'| 900000| 22| 19/10/2019

0: jdbc:hive2://127.0.0.1:10000> load data local inpath 'hdfs://localhost:54310/home/harmeet/deliandquote.csv' into table one OPTIONS("DELIMITER"="|", 'QUOTECHAR'="'");

Error: java.lang.Exception: DataLoad failure: CSV File provided is not proper. Column names in schema and csv header are not same. CSVFile Name : deliandquote.csv (state=,code=0)

2. ";" (Semicolon)

semiandquote.csv File >>

0: jdbc:hive2://127.0.0.1:10000> load data local inpath 'hdfs://localhost:54310/home/harmeet/semiandquote.csv' into table one OPTIONS("DELIMITER"=";", 'QUOTECHAR'="'");

Error: org.apache.spark.sql.AnalysisException: missing EOF at 'OPTIONS' near 'one'; line 1 pos 93 (state=,code=0)

I am not getting, why the different errors are shown, if we are not supporting other characters. Or this is the defect of carbondata ?