mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ES|QL] Updates functions metadata (#205472)
## Summary Manual update of the function metadata as the script failed on Monday.
This commit is contained in:
parent
cf3c7bd7b9
commit
c2d20d3b4e
3 changed files with 543 additions and 16 deletions
|
@ -1341,6 +1341,64 @@ const stCentroidAggDefinition: FunctionDefinition = {
|
|||
examples: ['FROM airports\n| STATS centroid=ST_CENTROID_AGG(location)'],
|
||||
};
|
||||
|
||||
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
|
||||
const stExtentAggDefinition: FunctionDefinition = {
|
||||
type: 'agg',
|
||||
name: 'st_extent_agg',
|
||||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.st_extent_agg', {
|
||||
defaultMessage:
|
||||
'Calculate the spatial extent over a field with geometry type. Returns a bounding box for all values of the field.',
|
||||
}),
|
||||
preview: false,
|
||||
alias: undefined,
|
||||
signatures: [
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'cartesian_point',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'cartesian_shape',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'cartesian_shape',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'cartesian_shape',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'geo_point',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'geo_shape',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'geo_shape',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'geo_shape',
|
||||
},
|
||||
],
|
||||
supportedCommands: ['stats', 'inlinestats', 'metrics'],
|
||||
supportedOptions: undefined,
|
||||
validate: undefined,
|
||||
examples: ['FROM airports\n| WHERE country == "India"\n| STATS extent = ST_EXTENT_AGG(location)'],
|
||||
};
|
||||
|
||||
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
|
||||
const stdDevDefinition: FunctionDefinition = {
|
||||
type: 'agg',
|
||||
|
@ -1921,6 +1979,7 @@ export const aggregationFunctionDefinitions = [
|
|||
minDefinition,
|
||||
percentileDefinition,
|
||||
stCentroidAggDefinition,
|
||||
stExtentAggDefinition,
|
||||
stdDevDefinition,
|
||||
sumDefinition,
|
||||
topDefinition,
|
||||
|
|
|
@ -2177,6 +2177,84 @@ const greatestDefinition: FunctionDefinition = {
|
|||
examples: ['ROW a = 10, b = 20\n| EVAL g = GREATEST(a, b)'],
|
||||
};
|
||||
|
||||
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
|
||||
const hashDefinition: FunctionDefinition = {
|
||||
type: 'eval',
|
||||
name: 'hash',
|
||||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.hash', {
|
||||
defaultMessage:
|
||||
'Computes the hash of the input using various algorithms such as MD5, SHA, SHA-224, SHA-256, SHA-384, SHA-512.',
|
||||
}),
|
||||
preview: false,
|
||||
alias: undefined,
|
||||
signatures: [
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'algorithm',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
name: 'input',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'keyword',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'algorithm',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
name: 'input',
|
||||
type: 'text',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'keyword',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'algorithm',
|
||||
type: 'text',
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
name: 'input',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'keyword',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'algorithm',
|
||||
type: 'text',
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
name: 'input',
|
||||
type: 'text',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'keyword',
|
||||
},
|
||||
],
|
||||
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
|
||||
supportedOptions: ['by'],
|
||||
validate: undefined,
|
||||
examples: [],
|
||||
};
|
||||
|
||||
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
|
||||
const hypotDefinition: FunctionDefinition = {
|
||||
type: 'eval',
|
||||
|
@ -3446,7 +3524,7 @@ const matchDefinition: FunctionDefinition = {
|
|||
name: 'match',
|
||||
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.match', {
|
||||
defaultMessage:
|
||||
'Performs a match query on the specified field. Returns true if the provided query matches the row.',
|
||||
'Use `MATCH` to perform a match query on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on text fields, as well as other field types like boolean, dates, and numeric types.\n\nFor a simplified syntax, you can use the match operator `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.',
|
||||
}),
|
||||
preview: true,
|
||||
alias: undefined,
|
||||
|
@ -3455,8 +3533,248 @@ const matchDefinition: FunctionDefinition = {
|
|||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'boolean',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'boolean',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'boolean',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'date',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'date',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'date',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'date_nanos',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'date_nanos',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'date_nanos',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'ip',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'ip',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'ip',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
|
@ -3477,7 +3795,71 @@ const matchDefinition: FunctionDefinition = {
|
|||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'text',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
|
@ -3503,13 +3885,109 @@ const matchDefinition: FunctionDefinition = {
|
|||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'text',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'text',
|
||||
type: 'double',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'long',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'unsigned_long',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'version',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'keyword',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
returnType: 'boolean',
|
||||
},
|
||||
{
|
||||
params: [
|
||||
{
|
||||
name: 'field',
|
||||
type: 'version',
|
||||
optional: false,
|
||||
fieldsOnly: true,
|
||||
},
|
||||
{
|
||||
name: 'query',
|
||||
type: 'version',
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
|
@ -8370,7 +8848,7 @@ const termDefinition: FunctionDefinition = {
|
|||
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
|
||||
supportedOptions: ['by'],
|
||||
validate: undefined,
|
||||
examples: ['from books \n| where term(author, "gabriel") \n| keep book_no, title\n| limit 3;'],
|
||||
examples: ['FROM books \n| WHERE TERM(author, "gabriel") \n| KEEP book_no, title\n| LIMIT 3;'],
|
||||
};
|
||||
|
||||
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
|
||||
|
@ -10029,6 +10507,7 @@ export const scalarFunctionDefinitions = [
|
|||
floorDefinition,
|
||||
fromBase64Definition,
|
||||
greatestDefinition,
|
||||
hashDefinition,
|
||||
hypotDefinition,
|
||||
ipPrefixDefinition,
|
||||
kqlDefinition,
|
||||
|
|
|
@ -31,17 +31,6 @@ describe('validation', () => {
|
|||
'[MATCH] function is only supported in WHERE commands',
|
||||
]);
|
||||
});
|
||||
|
||||
it('shows errors if argument is not an index field ', async () => {
|
||||
const { expectErrors } = await setup();
|
||||
await expectErrors(
|
||||
'FROM index | LIMIT 10 | where MATCH(`kubernetes.something.something`, "value")',
|
||||
[
|
||||
'Argument of [match] must be [keyword], found value [kubernetes.something.something] type [double]',
|
||||
'[MATCH] function cannot be used after LIMIT',
|
||||
]
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('QSRT function', () => {
|
||||
it('no error if valid', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue