Support Questions

Find answers, ask questions, and share your expertise

HUE Importer Error creating tables

avatar
New Contributor

I am trying to use the Hue Importer wizard to create tables in HIVE from a csv file, however, I keep getting "Already Exists" errors. After I run the wizard, a new table is created, but no data is entered into the table. It's almost like the wizard is trying to run the wrong SQL code. Is there any way to fix this? Here's an example of the errors thrown:

 

undefined
INFO  : Compiling command(queryId=hive_20180405113737_29576094-fb5c-4bc8-9e0f-401032c0f9b1): CREATE TABLE `napstg`.`us000022010_tst25`
(
  `FILEID` string ,
  `STUSAB` string ,
  `CHARITER` bigint ,
  `CIFSN` bigint ,
  `LOGRECNO` bigint ,
  `P0020001` bigint ,
  `P0020002` bigint ,
  `P0020003` bigint ,
  `P0020004` bigint ,
  `P0020005` bigint ,
  `P0020006` bigint ) ROW FORMAT   DELIMITED
    FIELDS TERMINATED BY ','
    COLLECTION ITEMS TERMINATED BY '\002'
    MAP KEYS TERMINATED BY '\003'
  STORED AS TextFile TBLPROPERTIES("skip.header.line.count" = "1")
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20180405113737_29576094-fb5c-4bc8-9e0f-401032c0f9b1); Time taken: 0.1 seconds
INFO  : Executing command(queryId=hive_20180405113737_29576094-fb5c-4bc8-9e0f-401032c0f9b1): CREATE TABLE `napstg`.`us000022010_tst25`
(
  `FILEID` string ,
  `STUSAB` string ,
  `CHARITER` bigint ,
  `CIFSN` bigint ,
  `LOGRECNO` bigint ,
  `P0020001` bigint ,
  `P0020002` bigint ,
  `P0020003` bigint ,
  `P0020004` bigint ,
  `P0020005` bigint ,
  `P0020006` bigint ) ROW FORMAT   DELIMITED
    FIELDS TERMINATED BY ','
    COLLECTION ITEMS TERMINATED BY '\002'
    MAP KEYS TERMINATED BY '\003'
  STORED AS TextFile TBLPROPERTIES("skip.header.line.count" = "1")
INFO  : Starting task [Stage-0:DDL] in serial mode
ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table us000022010_tst25 already exists)
INFO  : Completed executing command(queryId=hive_20180405113737_29576094-fb5c-4bc8-9e0f-401032c0f9b1); Time taken: 0.029 seconds

 

Here are the first 3 lines (including the header) of the dataset:

"FILEID","STUSAB","CHARITER","CIFSN","LOGRECNO","P0020001","P0020002","P0020003","P0020004","P0020005","P0020006"
"SF1US","US","000","02",1,308745538,0,0,0,0,308745538
"SF1US","US","000","02",2,994878,0,0,0,0,994878

 

 

Also, on a slightly unrelated note, is there any way to add delimiters such as "|" or "^" to the wizard? We have some less technically savy users who would like to run some self-service data ingest jobs.  

2 REPLIES 2

avatar
Super Guru

Here is fails at the CREATE has is does not detect that the table already exist.

 

You could try to load the data via the Table Browser page of the existing table. Or recreate the table if you can.

 

Note that the importer will support loading data soon so this use case will be smooth.

avatar
New Contributor
Thank you for the response, but I get the same error even when I try to create a table with different names. It is almost as if Hue is creating an empty table with only the schema, and when it tries inserting the data, it throws the error that the table already exists.

I have no problems when I use a Spark script to load the CSV.

Do you mean that at this time, the importer does NOT support loading data from CSV into Hive tables?