Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to check and filter blank values from a file based on an integer column and using the tfilterrow component. How can I use the tfilter row component properties. Can anyone help me on this?
I am doing currently as below:
column - (integer column)
function - empty.
operator - equals
value - ""/'' (this is giving me an error)
Appreciate your help.
Make sure the nullable box is checked on tDBInput component, while this option is enable, the component will read the null value as null, otherwise, it is 0 for int type.
@Richard Hall
I was just trying by putting value as ""/"" but its not the correct one. The data type at source and target both end is integer only.
Hi @tech seeker ,
Is the col1 and col2 are of integer type?
Can you put value for both cols as blank as you gave the value 345 for col1?
I have completed full blank line at the end and need to remove it using filter row
Hi @tech seeker ,
This is the same as Scenario where need to ignore the last line from pipe delimited file.
where you have mentioned to use tsystem component to use. I am trying the same using filter row. Is it possible to ignore the end line (blank).
@Shicong Hong ,
I did this as well, but it didn't work.
OK, for debugging, try to print the value on a on tJavaRow to see what value it is, null or empty string?
System.out.println(input_row.columnName);
or check if the value is null or empty string, eg:
if(input_row.columnName==null){
System.out.println("It is null value");
}
if(input_row.columnName.equals("")){
System.out.println("It is empty string");
}
Check and confirm what value it is before you do the filter.
Regards
Shong
@Vrushabh Malbari It might also help to see a screenshot of the schema setup of the source, target and the tFilterRow components. It sounds to me like there is an issue here. If you can supply ""/'' to the column, it isn't an integer.
Also, int cannot be null. Integer can be null. So you need to make sure that your column is set to Integer and not int.
Hi @Richard Hall ,
Its integer in schema. I am supplying null in value and not "/"".
Hi @rhall (Customer) ,
Its integer in schema. I am supplying null in value and not "/"".
Hi @Shicong Hong ,
OK, for debugging, try to print the value on a on tJavaRow to see what value it is, null or empty string?
System.out.println(input_row.columnName);
or check if the value is null or empty string, eg:
if(input_row.columnName==null){
System.out.println("It is null value");
}
if(input_row.columnName.equals("")){
System.out.println("It is empty string");
}
Check and confirm what value it is before you do the filter.
where I need to use the above code in my design.
My design is as below:
tdbinput--> tfileoutputdelimited --> tfilterrow --> tfileoutputdelimited
So you want me to use tjava in between tfileoutputdelimited-->tfilterrow?
If yes, I have done that, but I just got the values, not "it is null" or "it is empty."
But still, I am getting one extra line (blank) in my target output file.