75
75
"pivot": {
76
76
"group_by": {
77
77
"airline": {"terms": {"field": "airline"}},
78
- "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-dd HH" }}},
78
+ "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
79
79
"aggs": {
80
80
"avg_response": {"avg": {"field": "responsetime"}},
81
81
"time.max": {"max": {"field": "time"}},
@@ -84,17 +84,17 @@ setup:
84
84
}
85
85
}
86
86
- match : { preview.0.airline: foo }
87
- - match : { preview.0.by-hour: "2017-02-18 00" }
87
+ - match : { preview.0.by-hour: 1487376000000 }
88
88
- match : { preview.0.avg_response: 1.0 }
89
89
- match : { preview.0.time.max: "2017-02-18T00:30:00.000Z" }
90
90
- match : { preview.0.time.min: "2017-02-18T00:00:00.000Z" }
91
91
- match : { preview.1.airline: bar }
92
- - match : { preview.1.by-hour: "2017-02-18 01" }
92
+ - match : { preview.1.by-hour: 1487379600000 }
93
93
- match : { preview.1.avg_response: 42.0 }
94
94
- match : { preview.1.time.max: "2017-02-18T01:00:00.000Z" }
95
95
- match : { preview.1.time.min: "2017-02-18T01:00:00.000Z" }
96
96
- match : { preview.2.airline: foo }
97
- - match : { preview.2.by-hour: "2017-02-18 01" }
97
+ - match : { preview.2.by-hour: 1487379600000 }
98
98
- match : { preview.2.avg_response: 42.0 }
99
99
- match : { preview.2.time.max: "2017-02-18T01:01:00.000Z" }
100
100
- match : { preview.2.time.min: "2017-02-18T01:01:00.000Z" }
@@ -123,22 +123,22 @@ setup:
123
123
"pivot": {
124
124
"group_by": {
125
125
"airline": {"terms": {"field": "airline"}},
126
- "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-dd HH" }}},
126
+ "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
127
127
"aggs": {
128
128
"avg_response": {"avg": {"field": "responsetime"}}
129
129
}
130
130
}
131
131
}
132
132
- match : { preview.0.airline: foo }
133
- - match : { preview.0.by-hour: "2017-02-18 00" }
133
+ - match : { preview.0.by-hour: 1487376000000 }
134
134
- match : { preview.0.avg_response: 1.0 }
135
135
- match : { preview.0.my_field: 42 }
136
136
- match : { preview.1.airline: bar }
137
- - match : { preview.1.by-hour: "2017-02-18 01" }
137
+ - match : { preview.1.by-hour: 1487379600000 }
138
138
- match : { preview.1.avg_response: 42.0 }
139
139
- match : { preview.1.my_field: 42 }
140
140
- match : { preview.2.airline: foo }
141
- - match : { preview.2.by-hour: "2017-02-18 01" }
141
+ - match : { preview.2.by-hour: 1487379600000 }
142
142
- match : { preview.2.avg_response: 42.0 }
143
143
- match : { preview.2.my_field: 42 }
144
144
@@ -166,7 +166,7 @@ setup:
166
166
"pivot": {
167
167
"group_by": {
168
168
"airline": {"terms": {"field": "airline"}},
169
- "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-dd HH" }}},
169
+ "by-hour": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
170
170
"aggs": {"avg_response": {"avg": {"field": "responsetime"}}}
171
171
}
172
172
}
@@ -180,7 +180,7 @@ setup:
180
180
"source": { "index": "airline-data" },
181
181
"pivot": {
182
182
"group_by": {
183
- "time": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-DD HH" }}},
183
+ "time": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
184
184
"aggs": {
185
185
"avg_response": {"avg": {"field": "responsetime"}},
186
186
"time.min": {"min": {"field": "time"}}
@@ -189,20 +189,43 @@ setup:
189
189
}
190
190
191
191
- do :
192
- catch : /mixed object types of nested and non-nested fields \[time.min\] /
192
+ catch : /field \[time\] cannot be both an object and a field /
193
193
data_frame.preview_data_frame_transform :
194
194
body : >
195
195
{
196
196
"source": { "index": "airline-data" },
197
197
"pivot": {
198
198
"group_by": {
199
- "time": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-DD HH" }}},
199
+ "time": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
200
200
"aggs": {
201
201
"avg_response": {"avg": {"field": "responsetime"}},
202
202
"time.min": {"min": {"field": "time"}}
203
203
}
204
204
}
205
205
}
206
+ - do :
207
+ catch : /field \[super_metric\] cannot be both an object and a field/
208
+ data_frame.preview_data_frame_transform :
209
+ body : >
210
+ {
211
+ "source": { "index": "airline-data" },
212
+ "pivot": {
213
+ "group_by": {
214
+ "time": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
215
+ "aggs": {
216
+ "avg_response": {"avg": {"field": "responsetime"}},
217
+ "super_metric.time": {"min": {"field": "time"}},
218
+ "super_metric": {
219
+ "scripted_metric": {
220
+ "init_script": "",
221
+ "map_script": "",
222
+ "combine_script": "",
223
+ "reduce_script": "return ['value1': 1, 'value2':2]"
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
206
229
---
207
230
" Test preview with missing pipeline " :
208
231
- do :
@@ -214,7 +237,7 @@ setup:
214
237
"dest": { "pipeline": "missing-pipeline" },
215
238
"pivot": {
216
239
"group_by": {
217
- "time": {"date_histogram": {"fixed_interval": "1h", "field": "time", "format": "yyyy-MM-DD HH" }}},
240
+ "time": {"date_histogram": {"fixed_interval": "1h", "field": "time"}}},
218
241
"aggs": {
219
242
"avg_response": {"avg": {"field": "responsetime"}},
220
243
"time.min": {"min": {"field": "time"}}
0 commit comments