Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

Highlighted

ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

Explorer

I am trying to load a csv file with headers with exactly same spelling and caps as in the PostgreSQL DB table.

 

 

Error:

 

putdatabaserecord.error
Batch entry 0 INSERT INTO analytics_dev.op_working_time_nifi (T_CODE, V_NO, C_SIZE, M_TYPE, T_IND, F_EMPTY, IV, O_NAME, S_DATE, S_TIME, Q_NAME, C_HR, W_START_TIME, OP_W_MINS, T_MOVES) VALUES ('AB-2','153443','22','VS','NOT T','F','M42','206014500','4/5/2019','Night S','QB03','26','2019-04-05T22:03:36','3.683344363','3') was aborted: ERROR: column "t_code" of relation "working_time_nifi" does not exist Position: 49 Call getNextException to see other errors in the batch.
 
Schema of the table:
CREATE TABLE analytics_dev.working_time_nifi
(
"T_CODE" text,
"V_NO" text,
"C_SIZE" bigint,
"M_TYPE" text,
"T_IND" text,
"F_EMPTY" text,
"IV" text,
"O_NAME" text,
"S_DATE" date,
"S_TIME" text,
"Q_NAME" text,
"C_HR" float8,
"W_START_TIME" timestamp,
"OP_W_MINS" float8,
"T_MOVES" bigint
);
 
Any help as to why this is happening?
4 REPLIES 4
Highlighted

Re: ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

Explorer

The table name is different in than the one which you are trying to load data.

 

Please notice carefully that the error in Nifi is complaining about below table, whereas in your create table there is no prefix with the name "op"

 

op_working_time_nifi

 

Highlighted

Re: ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

Explorer

Hey that's a mistake in my typing as I had to mask col and table name. That's not an issue. Can you find anything else? It would be a good help in solving this then.

Highlighted

Re: ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

@Raj2cool16 Can you update the original post, or send a reply here, showing the processor configuration and associated reader configurations?     I believe there are some settings in the Processor and the Reader to effect your issue.

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Re: ERROR while loading CSV to PostgreSQL using PutDatabaseRecord through NiFi

Explorer

PFB the full configuration details of PutDatabaseRecord and CSVReader.

 

PutDatabaseRecord SS Part 1:

PutDatabaseRecord SS Part 1PutDatabaseRecord SS Part 1

 

PutDatabaseRecord SS Part 2:

PutDatabaseRecord SS Part 2:PutDatabaseRecord SS Part 2:

 

CSVReader ss part 1:

CSVReader SS part 1CSVReader SS part 1

 

CSVReader ss part 2:

CSVReader ss part 2CSVReader ss part 2

 

CSVReader ss part 3:

CSVReader ss part 3CSVReader ss part 3

 

 

Please let me know if anything else is needed, also if I need to tweak on settings or add/remove processors.

Don't have an account?
Coming from Hortonworks? Activate your account here