[ 
https://issues.apache.org/jira/browse/PHOENIX-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740133#comment-14740133
 ] 

James Taylor commented on PHOENIX-2239:
---------------------------------------

Thanks for the patch, [~gabriel.reid]. I suspected that the strict option would 
only work for the non MR loader. Perhaps we can file a JIRA to support it for 
the MR loader too just to track it?

Couple minor nits:
- Looks like there's some System.out.println() calls left in some of the tests.
- How about passing the original Exception through the errorOnRecord call 
instead of just the message? Then wrap it in a RuntimeException. That way, our 
JDBC driver will automatically unwrap the RuntimeException and re-throw the 
SQLException. It'd be good to keep the csvRecord state in the exception too 
somehow - not sure what the best way would be. I supposed we could just log it.


> Honor strict option when catching data error during CSV load
> ------------------------------------------------------------
>
>                 Key: PHOENIX-2239
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2239
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>         Attachments: PHOENIX-2239.patch
>
>
> The Phoenix CSV Bulk Loader has a strict option (i.e. -s or --strict) which 
> is intended to abort the load if a data error is found. Looks like we're not 
> passing this option through the errorOnRecord method, but I think that'd be a 
> good (and likely pretty easy) improvement:
> {code}
>         @Override
>         public void errorOnRecord(CSVRecord csvRecord, String errorMessage) {
>             LOG.error("Error upserting record {}: {}", csvRecord, 
> errorMessage);
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to