-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ES|QL] Implicit casting string literal to intervals in EsqlScalarFunction and GroupingFunction #115814
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
[ES|QL] Implicit casting string literal to intervals in EsqlScalarFunction and GroupingFunction #115814
Changes from all commits
b801ba8
7c77785
b416e77
28c2fe8
d41b5d1
0ff8ca8
e0f7376
7cb0c7c
11fa25d
6a81ea6
f17b304
dc850d7
8b31b45
bace39a
4c39d94
a8b1b0f
26a0be7
0edf60f
9c9a95f
67b6885
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 115814 | ||
summary: "[ES|QL] Implicit casting string literal to intervals" | ||
area: ES|QL | ||
type: enhancement | ||
issues: | ||
- 115352 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
import java.util.function.Function; | ||
|
||
import static java.util.stream.Collectors.toMap; | ||
import static java.util.stream.Collectors.toUnmodifiableMap; | ||
import static org.elasticsearch.xpack.esql.core.util.PlanStreamInput.readCachedStringWithVersionCheck; | ||
import static org.elasticsearch.xpack.esql.core.util.PlanStreamOutput.writeCachedStringWithVersionCheck; | ||
|
||
|
@@ -276,7 +275,7 @@ public enum DataType { | |
|
||
private static final Collection<DataType> STRING_TYPES = DataType.types().stream().filter(DataType::isString).toList(); | ||
|
||
private static final Map<String, DataType> NAME_TO_TYPE = TYPES.stream().collect(toUnmodifiableMap(DataType::typeName, t -> t)); | ||
private static final Map<String, DataType> NAME_TO_TYPE; | ||
|
||
private static final Map<String, DataType> ES_TO_TYPE; | ||
|
||
|
@@ -287,6 +286,10 @@ public enum DataType { | |
map.put("point", DataType.CARTESIAN_POINT); | ||
map.put("shape", DataType.CARTESIAN_SHAPE); | ||
ES_TO_TYPE = Collections.unmodifiableMap(map); | ||
// DATETIME has different esType and typeName, add an entry in NAME_TO_TYPE with date as key | ||
map = TYPES.stream().collect(toMap(DataType::typeName, t -> t)); | ||
map.put("date", DataType.DATETIME); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this not go into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked into |
||
NAME_TO_TYPE = Collections.unmodifiableMap(map); | ||
} | ||
|
||
private static final Map<String, DataType> NAME_OR_ALIAS_TO_TYPE; | ||
|
Uh oh!
There was an error while loading. Please reload this page.