You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
In using tMysqlBulkExec for Infobright after tOracleInput I found problem if \N enclose with Double-quotations in output file, Infobright loader will load this column as 0 or \ instead of null but in mysql is OK!
So how I can enclose other columns with " except null columns ( ;\N; instead of ;"\N"; ) or do not produce any thing for null columns ( ;; instead of ;"\N"![]()
I tried any compunenet but I couldent generate export file in this format.
Infobright loader need this out put for simple table ( id int, name varcahr2, type int, end date)
"1";"ATK";;"2010-01-01" or "1";"ATK";\N;"2010-01-01"
insted of
"1";"ATK";"\N";"2010-01-01" or "1";"ATK";"";"2010-01-01" ( these two rows insert 0 instead of null in table)
Hi
Before loading the file, read the file and remove the "\N" in each row and regenerate the file again.
row1.line.subSequence(0, row1.line.indexOf("\\N")-1)+row1.line.substring(row1.line.indexOf("\\N")+3)Best regards
Shong
Offline
Hi
Thank you for your reply,
Because currently I have around 80 designed&tested jobs( They have not any problem with Mysql, only with Infobright). is it possible to inject this code to tMysqlOutputBulkExec component instead of changing all my job and add extra component for this matter?
Last edited by atkmain (2010-08-10 03:58:18)
Offline
Hi
Can you see my screenshot? You can see I am using the tFileInputFullRow component to read the file.
There is no reject link on tMysqlOutputBulkExec.
Best regards
Shong
Offline
Hi,
Yes I saw your attached pictures. As you can see in my attached picture I done with 6 component and below code to replace them
row1.line.replace("\"\\N\"", "") ;but currently I did it with linux sed command that is more easy and faster.
I created a custom component for myself but is seems remove double-quotation around \N is hard and it come from CSVwriter class that is belong to taland core class.
But sill I think it is not efficient way.So, I found bug point in Infobright 3.4 in file : DataParserForText.cpp that fixing and keep compiling is huge effort
void DataParserForText::PrepareNulls()
{
if(!IsLastColumn()) {
for(int i = 0; i < no_prepared; i++) {
int rs = row_sizes[i];
if(
*values_ptr[i] == delimiter ||
(((values_ptr[i] + 5) < (rows_ptr[i] + rs)) && strncasecmp(values_ptr[i], "NULL", 4) == 0
&& (*(values_ptr[i] + 4) == delimiter)) ||
(((values_ptr[i] + 3) < (rows_ptr[i] + rs)) && strncasecmp(values_ptr[i], "\\N", 2) == 0
&& (*(values_ptr[i] + 2) == delimiter))
)
nulls[i] = 1;
else
nulls[i] = 0;
}Thank you fr your help
Offline
Pages: 1