Reputation: 45
In the release notes of version 4.0.6 GA, we can found that the first new feature is "Infobright Loader now supports a Reject file"
But I cannot find anything more about this, just like how to use it, and in which case we may need it.
Please help
Upvotes: 0
Views: 281
Reputation: 464
To enable the reject file functionality, you must specify BH_REJECT_FILE_PATH and one of the associated parameters (BH_ABORT_ON_COUNT or BH_ABORT_ON_THRESHOLD). For example, if you want to load data from the file DATAFILE.csv to table T but you expects that 10 rows in this file might be wrongly formatted, you would run the following commands:
set @BH_REJECT_FILE_PATH = '/tmp/reject_file';
set @BH_ABORT_ON_COUNT = 10;
load data infile DATAFILE.csv into table T;
If less than 10 rows are rejected, a warning will be output, the load will succeed and all problematic rows will be output to the file /tmp/reject_file. If the Infobright Loader finds a tenth bad row, the load will terminate with an error and all bad rows found so far will be output to the file /tmp/reject_file.
Upvotes: 0