diff --git a/processing/src/main/java/io/druid/query/ordering/StringComparator.java b/processing/src/main/java/io/druid/query/ordering/StringComparator.java index f61cab877a2..d88c78ecc8a 100644 --- a/processing/src/main/java/io/druid/query/ordering/StringComparator.java +++ b/processing/src/main/java/io/druid/query/ordering/StringComparator.java @@ -29,7 +29,7 @@ public abstract class StringComparator implements Comparator @JsonCreator public static StringComparator fromString(String type) { - switch (type) { + switch (type.toLowerCase()) { case StringComparators.LEXICOGRAPHIC_NAME: return StringComparators.LEXICOGRAPHIC; case StringComparators.ALPHANUMERIC_NAME: diff --git a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java index 1273921b29b..b40f721f451 100644 --- a/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java +++ b/processing/src/test/java/io/druid/query/ordering/StringComparatorsTest.java @@ -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)); } }