mirror of https://github.com/apache/druid.git
Merge pull request #943 from mrijke/partialdimextractfn-nullpointer
Fix NullPointerException in PartialDimExtractionFn
This commit is contained in:
commit
be507b8cb4
|
@ -58,6 +58,7 @@ public class PartialDimExtractionFn implements DimExtractionFn
|
|||
@Override
|
||||
public String apply(String dimValue)
|
||||
{
|
||||
dimValue = (dimValue == null) ? "" : dimValue;
|
||||
Matcher matcher = pattern.matcher(dimValue);
|
||||
return matcher.find() ? dimValue : null;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ public class PartialDimExtractionFnTest
|
|||
"Vancouver",
|
||||
"Pretoria",
|
||||
"Wellington",
|
||||
null,
|
||||
"Ontario"
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue