[
https://issues.apache.org/jira/browse/FLUME-722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079867#comment-13079867
]
Jonathan Hsieh commented on FLUME-722:
--------------------------------------
@Mingjie
Nice catch! I agree this is a bad code smell. Am I right to assume that after
the patch, the { : 210.5.102.6 } and { :194.78.100.30 } parts are not present?
I'm really curious about how to duplicate this and why this happens and would
really like to figure this out before we commit. I've tried to make a test
case that would make an "" attribute show up but I can't seem to do it either.
Can you give a scrubbed example line? Do they look like:
"1.2.3.4\txxxLicense\t1304406740\t42\txxxUrl"
Also, a style nit -- can you invert the equals expression to eliminate the
possibility of a NPE? This could be done by changing:
!names.get(grp-1).equals("")
into
!"".equals(names.get(grp-1))
> RegexAllExtractor doesn't ignore empty groups
> ---------------------------------------------
>
> Key: FLUME-722
> URL: https://issues.apache.org/jira/browse/FLUME-722
> Project: Flume
> Issue Type: Bug
> Components: Sinks+Sources
> Affects Versions: v0.9.4
> Reporter: Nicholas Verbeck
> Assignee: Mingjie Lai
> Priority: Minor
> Labels: decorator, regexall
> Attachments: FLUME-722.patch
>
>
> Hi flume devs.
> I saw a bug when using RegexAllExtractor: line 94:
> if(names.get(grp-1) != ""){
> Attributes.setString(e, names.get(grp-1), val);
> }
> Please help to file a jira and correct it to use String.equal(), otherwise it
> doesn't ignore empty groups.
> (I don't think I can open a issue at cloudera jira.)
> Thanks,
> Mingjie
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira