forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ES|QL] Update
bucket
signature (elastic#181787)
## Summary Wraps in the changes from elastic/elasticsearch#107272 <img width="491" alt="Screenshot 2024-04-25 at 4 46 31 PM" src="https://github.com/elastic/kibana/assets/315764/4fb3db49-7702-466b-b1fd-b22ca3ed7a0d"> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (still needs to be done... waiting on elastic/elasticsearch#107918)
- Loading branch information
1 parent
9ae3b64
commit 5c69e1f
Showing
9 changed files
with
400 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
packages/kbn-esql-validation-autocomplete/src/definitions/grouping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { FunctionDefinition } from './types'; | ||
|
||
export const groupingFunctionDefinitions: FunctionDefinition[] = [ | ||
{ | ||
name: 'bucket', | ||
alias: ['bin'], | ||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.autoBucketDoc', { | ||
defaultMessage: `Automatically bucket dates based on a given range and bucket target.`, | ||
}), | ||
type: 'grouping', | ||
supportedCommands: [], | ||
supportedOptions: ['by'], | ||
signatures: [ | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'date' }, | ||
{ name: 'buckets', type: 'time_literal', constantOnly: true }, | ||
], | ||
returnType: 'date', | ||
examples: ['from index | eval hd = bucket(hire_date, 1 hour)'], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'number' }, | ||
{ name: 'buckets', type: 'time_literal', constantOnly: true }, | ||
], | ||
returnType: 'number', | ||
examples: ['from index | eval hd = bucket(bytes, 1 hour)'], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'date' }, | ||
{ name: 'buckets', type: 'number', constantOnly: true }, | ||
{ name: 'startDate', type: 'string', constantOnly: true }, | ||
{ name: 'endDate', type: 'string', constantOnly: true }, | ||
], | ||
returnType: 'date', | ||
examples: [ | ||
'from index | eval hd = bucket(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")', | ||
], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'date' }, | ||
{ name: 'buckets', type: 'number', constantOnly: true }, | ||
{ name: 'startDate', type: 'date', constantOnly: true }, | ||
{ name: 'endDate', type: 'date', constantOnly: true }, | ||
], | ||
returnType: 'date', | ||
examples: [ | ||
'from index | eval hd = bucket(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")', | ||
], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'date' }, | ||
{ name: 'buckets', type: 'number', constantOnly: true }, | ||
{ name: 'startDate', type: 'string', constantOnly: true }, | ||
{ name: 'endDate', type: 'date', constantOnly: true }, | ||
], | ||
returnType: 'date', | ||
examples: [ | ||
'from index | eval hd = bucket(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")', | ||
], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'date' }, | ||
{ name: 'buckets', type: 'number', constantOnly: true }, | ||
{ name: 'startDate', type: 'date', constantOnly: true }, | ||
{ name: 'endDate', type: 'string', constantOnly: true }, | ||
], | ||
returnType: 'date', | ||
examples: [ | ||
'from index | eval hd = bucket(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")', | ||
], | ||
}, | ||
{ | ||
params: [ | ||
{ name: 'field', type: 'number' }, | ||
{ name: 'buckets', type: 'number', constantOnly: true }, | ||
{ name: 'startValue', type: 'number', constantOnly: true }, | ||
{ name: 'endValue', type: 'number', constantOnly: true }, | ||
], | ||
returnType: 'number', | ||
examples: ['from index | eval bs = bucket(bytes, 20, 25324, 74999)'], | ||
}, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.