Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/127797.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 127797
summary: "Date nanos implicit casting in union types option #2"
area: ES|QL
type: enhancement
issues:
- 110009
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class DateUtils {
.appendValue(MINUTE_OF_HOUR, 2)
.appendLiteral(':')
.appendValue(SECOND_OF_MINUTE, 2)
.appendFraction(NANO_OF_SECOND, 3, 9, true)
.appendFraction(NANO_OF_SECOND, 0, 9, true)
.appendOffsetId()
.toFormatter(Locale.ROOT);

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/esql/qa/server/single-node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
javaRestTestImplementation project(xpackModule('esql:qa:testFixtures'))
javaRestTestImplementation project(xpackModule('esql:qa:server'))
javaRestTestImplementation project(xpackModule('esql:tools'))
javaRestTestImplementation project(xpackModule('esql'))
yamlRestTestImplementation project(xpackModule('esql:qa:server'))

javaRestTestImplementation('org.apache.arrow:arrow-vector:16.1.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public class CsvTestsDataLoader {
);
private static final TestDataset AIRPORTS_WEB = new TestDataset("airports_web");
private static final TestDataset DATE_NANOS = new TestDataset("date_nanos");
private static final TestDataset DATE_NANOS_UNION_TYPES = new TestDataset("date_nanos_union_types");
private static final TestDataset COUNTRIES_BBOX = new TestDataset("countries_bbox");
private static final TestDataset COUNTRIES_BBOX_WEB = new TestDataset("countries_bbox_web");
private static final TestDataset AIRPORT_CITY_BOUNDARIES = new TestDataset("airport_city_boundaries");
Expand Down Expand Up @@ -162,6 +163,7 @@ public class CsvTestsDataLoader {
Map.entry(MULTIVALUE_GEOMETRIES.indexName, MULTIVALUE_GEOMETRIES),
Map.entry(MULTIVALUE_POINTS.indexName, MULTIVALUE_POINTS),
Map.entry(DATE_NANOS.indexName, DATE_NANOS),
Map.entry(DATE_NANOS_UNION_TYPES.indexName, DATE_NANOS_UNION_TYPES),
Map.entry(K8S.indexName, K8S),
Map.entry(DISTANCES.indexName, DISTANCES),
Map.entry(ADDRESSES.indexName, ADDRESSES),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
millis:date_nanos,nanos:date,num:long
2023-10-23T13:55:01.543123456Z,2023-10-23T13:55:01.543Z,1698069301543123456
2023-10-23T13:55:01.543123456Z,2023-10-23T13:55:01.543Z,1698069301543123456
2023-10-23T13:53:55.832987654Z,2023-10-23T13:53:55.832Z,1698069235832987654
2023-10-23T13:52:55.015787878Z,2023-10-23T13:52:55.015Z,1698069175015787878
2023-10-23T13:51:54.732102837Z,2023-10-23T13:51:54.732Z,1698069114732102837
2023-10-23T13:33:34.937193000Z,2023-10-23T13:33:34.937Z,1698068014937193000
2023-10-23T12:27:28.948000000Z,2023-10-23T12:27:28.948Z,1698064048948000000
2023-10-23T12:15:03.360103847Z,2023-10-23T12:15:03.360Z,1698063303360103847
2023-10-23T12:15:03.360103847Z,2023-10-23T12:15:03.360Z,1698063303360103847
1999-10-23T12:15:03.360103847Z,[2023-03-23T12:15:03.360Z, 2023-02-23T13:33:34.937Z, 2023-01-23T13:55:01.543Z], 0
1999-10-22T12:15:03.360103847Z,[2023-03-23T12:15:03.360Z, 2023-03-23T12:15:03.360Z, 2023-03-23T12:15:03.360Z], 0
2023-10-23T12:15:03.360103847Z,1923-10-23T12:15:03.360Z,1698063303360103847
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
birth_date:date_nanos ,emp_no:long,first_name:text,gender:text,hire_date:date_nanos,languages:byte,languages.long:long,languages.short:short,languages.byte:byte,last_name:text,salary:long,height:float,height.double:double,height.scaled_float:scaled_float,height.half_float:half_float,still_hired:keyword,avg_worked_seconds:unsigned_long,job_positions:text,is_rehired:keyword,salary_change:float,salary_change.int:integer,salary_change.long:long,salary_change.keyword:keyword
birth_date:date ,emp_no:long,first_name:text,gender:text,hire_date:date_nanos,languages:byte,languages.long:long,languages.short:short,languages.byte:byte,last_name:text,salary:long,height:float,height.double:double,height.scaled_float:scaled_float,height.half_float:half_float,still_hired:keyword,avg_worked_seconds:unsigned_long,job_positions:text,is_rehired:keyword,salary_change:float,salary_change.int:integer,salary_change.long:long,salary_change.keyword:keyword
1953-09-02T00:00:00Z,10001,Georgi ,M,1986-06-26T00:00:00Z,2,2,2,2,Facello ,57305,2.03,2.03,2.03,2.03,true ,268728049,[Senior Python Developer,Accountant],[false,true],[1.19],[1],[1],[1.19]
1964-06-02T00:00:00Z,10002,Bezalel ,F,1985-11-21T00:00:00Z,5,5,5,5,Simmel ,56371,2.08,2.08,2.08,2.08,true ,328922887,[Senior Team Lead],[false,false],[-7.23,11.17],[-7,11],[-7,11],[-7.23,11.17]
1959-12-03T00:00:00Z,10003,Parto ,M,1986-08-28T00:00:00Z,4,4,4,4,Bamford ,61805,1.83,1.83,1.83,1.83,false,200296405,[],[],[14.68,12.82],[14,12],[14,12],[14.68,12.82]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"properties": {
"millis": {
"type": "date_nanos"
},
"nanos": {
"type": "date"
},
"num": {
"type": "long"
}
}
}
Loading