I'm wondering if somebody can provide some guidance on how to use 
CsvBulkLoadTool from within a Java Class, instead of via the command line, as 
is shown in the documentation. I'd like to determine if CsvBulkLoadTool ran 
without throwing any exceptions. However, exceptions generated by 
org.apache.phoenix.* don't seem to be thrown up to the calling method 
(ToolRunner.run), or at least result in a non-zero return code.

Here is what I am doing:
import org.apache.phoenix.mapreduce.CsvBulkLoadTool;
import org.apache.hadoop.util.ToolRunner;

CsvBulkLoadTool csvBulkLoader = new CsvBulkLoadTool();
int tret;
String[] args = {"-d", "\t", "--table", "MyTableName", "--input", 
"file://myfile.tsv"};

tret = ToolRunner.run(csvBulkLoader, args);

When I run this code, I get a return code (tret) of zero and no errors in the 
console output. However, the data is not loaded into HBase. When running the 
same commands on the command line, I discovered that Phoenix can throw various 
errors (e.g. wrong column datatype, permission error, whatever...). But there 
doesn't seem to be a way for me to discover these errors from either exceptions 
that CsvBulkLoadTool throws or via the return code.

What's the best way to determine if CsvBulkLoadTool ran without error?

Thanks,
Jonathan

Reply via email to