mirror of https://github.com/apache/druid.git
Make StringComparator deserialization case-insensitive (#3356)
This commit is contained in:
parent
18af480017
commit
454587857c
|
@ -29,7 +29,7 @@ public abstract class StringComparator implements Comparator<String>
|
|||
@JsonCreator
|
||||
public static StringComparator fromString(String type)
|
||||
{
|
||||
switch (type) {
|
||||
switch (type.toLowerCase()) {
|
||||
case StringComparators.LEXICOGRAPHIC_NAME:
|
||||
return StringComparators.LEXICOGRAPHIC;
|
||||
case StringComparators.ALPHANUMERIC_NAME:
|
||||
|
|
|
@ -207,5 +207,9 @@ public class StringComparatorsTest
|
|||
String makeFromJsonSpec = "\"numeric\"";
|
||||
Assert.assertEquals(StringComparators.NUMERIC
|
||||
, jsonMapper.readValue(makeFromJsonSpec, StringComparator.class));
|
||||
|
||||
makeFromJsonSpec = "\"NuMeRiC\"";
|
||||
Assert.assertEquals(StringComparators.NUMERIC
|
||||
, jsonMapper.readValue(makeFromJsonSpec, StringComparator.class));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue