From 3738073fca78cae43843112b0bec122d8619a391 Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Thu, 26 Sep 2019 13:41:31 -0700 Subject: [PATCH 1/2] fix(fluxFunctions): add getColumn, getRecord, tableFind --- ui/src/shared/constants/fluxFunctions.ts | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/ui/src/shared/constants/fluxFunctions.ts b/ui/src/shared/constants/fluxFunctions.ts index 3310cbf078d..d00bb4d1bce 100644 --- a/ui/src/shared/constants/fluxFunctions.ts +++ b/ui/src/shared/constants/fluxFunctions.ts @@ -960,6 +960,40 @@ export const FLUX_FUNCTIONS: FluxToolbarFunction[] = [ 'https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/float/', }, FROM, + { + name: 'getColumn', + args: [ + { + name: 'column', + desc: 'The name of the column to extract.', + type: 'String', + }, + ], + package: '', + desc: + 'Extracts a column from a table given its label. If the label is not present in the set of columns, the function errors.', + example: 'getColumn(column: "_value")', + category: 'Transformations', + link: + 'https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getcolumn/', + }, + { + name: 'getRecord', + args: [ + { + name: 'idx', + desc: 'The index of the record to extract.', + type: 'Integer', + }, + ], + package: '', + desc: + 'Extracts a record from a table given the record’s index. If the index is out of bounds, the function errors.', + example: 'getRecord(idx: 0)', + category: 'Transformations', + link: + 'https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/getrecord/', + }, { name: 'group', args: [ @@ -4054,6 +4088,23 @@ export const FLUX_FUNCTIONS: FluxToolbarFunction[] = [ link: 'https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/system/time/', }, + { + name: 'tableFind', + args: [ + { + name: 'fn', + desc: 'A predicate function for matching keys in a table group key.', + type: 'Function', + }, + ], + package: '', + desc: + 'Extracts the first table in a stream of tables whose group key values match a predicate. If no table is found, the function errors.', + example: 'tableFind(fn: (key) => key._field == "fieldName")', + category: 'Transformations', + link: + 'https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/built-in/transformations/stream-table/tablefind/', + }, { name: 'tail', args: [ From c07ccd7b9b5712184ef1d3cb2eedcb97d0081924 Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Thu, 26 Sep 2019 14:03:59 -0700 Subject: [PATCH 2/2] feat(changelog): update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024d610ad39..ab97560080b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ 1. [15040](https://github.com/influxdata/influxdb/pull/15040): Redesign check builder UI to fill the screen and make more room for composing message templates 1. [14990](https://github.com/influxdata/influxdb/pull/14990): Move Tokens tab from Settings to Load Data page 1. [14990](https://github.com/influxdata/influxdb/pull/14990): Expose all Settings tabs in navigation menu +1. [15289](https://github.com/influxdata/influxdb/pull/15289): Added Stream and table functions to query builder ### Bug Fixes