Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: cover the Integer type when extracting values from _source #42859

Merged
merged 5 commits into from Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -165,7 +165,11 @@ private Object unwrapMultiValue(Object values) {
return DateUtils.asDateTime(Long.parseLong(values.toString()), zoneId);
}
}
if (values instanceof Long || values instanceof Double || values instanceof String || values instanceof Boolean) {
if (values instanceof Integer
|| values instanceof Long
|| values instanceof Double
|| values instanceof String
|| values instanceof Boolean) {
return values;
}
throw new SqlIllegalArgumentException("Type {} (returned by [{}]) is not supported", values.getClass().getSimpleName(), fieldName);
Expand Down
Expand Up @@ -580,6 +580,7 @@ private Object randomValue() {
() -> randomAlphaOfLength(10),
ESTestCase::randomLong,
ESTestCase::randomDouble,
ESTestCase::randomInt,
() -> null));
return value.get();
}
Expand All @@ -588,7 +589,8 @@ private Object randomNonNullValue() {
Supplier<Object> value = randomFrom(Arrays.asList(
() -> randomAlphaOfLength(10),
ESTestCase::randomLong,
ESTestCase::randomDouble));
ESTestCase::randomDouble,
ESTestCase::randomInt));
return value.get();
}

Expand Down