ATLAS-3504-DSL-query-with-like-clause-returns-unexpected-results-v1.patch
Signed-off-by: Ashutosh Mestry <amestry@hortonworks.com>
This commit is contained in:
parent
9115e7d2da
commit
f6e252f8bb
|
|
@ -24,6 +24,8 @@ import java.io.IOException;
|
|||
import java.io.StringReader;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
|
|
@ -1077,6 +1079,10 @@ public class Solr6Index implements IndexProvider {
|
|||
} else if (AttributeUtil.isDecimal(dataType)) {
|
||||
if (dataType.equals(Float.class)) postfix = "_f";
|
||||
else postfix = "_d";
|
||||
} else if (dataType.equals(BigInteger.class)) {
|
||||
postfix = "_bi";
|
||||
} else if (dataType.equals(BigDecimal.class)) {
|
||||
postfix = "_bd";
|
||||
} else if (dataType.equals(Geoshape.class)) {
|
||||
postfix = "_g";
|
||||
} else if (dataType.equals(Date.class) || dataType.equals(Instant.class)) {
|
||||
|
|
@ -1086,6 +1092,7 @@ public class Solr6Index implements IndexProvider {
|
|||
} else if (dataType.equals(UUID.class)) {
|
||||
postfix = "_uuid";
|
||||
} else throw new IllegalArgumentException("Unsupported data type ["+dataType+"] for field: " + key);
|
||||
|
||||
if (keyInfo.getCardinality() == Cardinality.SET || keyInfo.getCardinality() == Cardinality.LIST) {
|
||||
postfix += "s";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,14 @@ public class DSLQueriesTest extends BasicTestSetup {
|
|||
@DataProvider(name = "comparisonQueriesProvider")
|
||||
private Object[][] comparisonQueriesProvider() {
|
||||
return new Object[][] {
|
||||
{"Person where (name = \"Julius\" )", 1},
|
||||
{"Person where (name like \"Jul*\" )", 1},
|
||||
{"Person where (name like \"J*\" )", 3},
|
||||
{"Person where (name like \"*us\" )", 1},
|
||||
{"Person where (name like \"*uli*\" )", 1},
|
||||
{"Person where (name like \"Julius\" )", 1},
|
||||
{"Person where (name like \"Jul\" )", 0},
|
||||
|
||||
{"Person where (birthday < \"1950-01-01T02:35:58.440Z\" )", 0},
|
||||
{"Person where (birthday > \"1975-01-01T02:35:58.440Z\" )", 2},
|
||||
{"Person where (birthday >= \"1975-01-01T02:35:58.440Z\" )", 2},
|
||||
|
|
|
|||
Loading…
Reference in New Issue