From f311c76a84a3714c24ae4bf99d0bb4592e29ec02 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 9 Jan 2023 16:15:08 -0700 Subject: [PATCH] Flux 0.192 (#4695) * flux 0.192.0 release notes * flux 0.192.0 stdlib updates --- content/flux/v0.x/release-notes.md | 21 ++ .../flux/v0.x/stdlib/contrib/qxip/_index.md | 36 ++++ .../stdlib/contrib/qxip/clickhouse/_index.md | 56 ++++++ .../stdlib/contrib/qxip/clickhouse/query.md | 100 ++++++++++ .../v0.x/stdlib/contrib/qxip/hash/_index.md | 44 +++++ .../stdlib/contrib/qxip/hash/cityhash64.md | 62 ++++++ .../v0.x/stdlib/contrib/qxip/hash/sha256.md | 64 ++++++ .../v0.x/stdlib/contrib/qxip/hash/xxhash64.md | 62 ++++++ .../v0.x/stdlib/contrib/qxip/logql/_index.md | 64 ++++++ .../stdlib/contrib/qxip/logql/query_range.md | 122 ++++++++++++ .../stdlib/experimental/geo/totaldistance.md | 154 +++++++++++++++ .../stdlib/experimental/http/requests/get.md | 2 +- .../stdlib/experimental/http/requests/peek.md | 8 +- .../flux/v0.x/stdlib/experimental/iox/from.md | 16 +- .../flux/v0.x/stdlib/experimental/iox/sql.md | 16 +- .../stdlib/experimental/iox/sqlinterval.md | 93 +++++++++ .../v0.x/stdlib/experimental/json/parse.md | 8 +- .../v0.x/stdlib/experimental/polyline/rdp.md | 186 +++++++++--------- content/flux/v0.x/stdlib/http/requests/get.md | 2 +- .../flux/v0.x/stdlib/http/requests/peek.md | 8 +- .../flux/v0.x/stdlib/http/requests/post.md | 6 +- content/flux/v0.x/stdlib/universe/contains.md | 55 ++---- .../flux/v0.x/stdlib/universe/covariance.md | 14 +- content/flux/v0.x/stdlib/universe/map.md | 28 +-- content/flux/v0.x/stdlib/universe/union.md | 8 +- layouts/partials/article/flux-contrib.html | 6 +- 26 files changed, 1064 insertions(+), 177 deletions(-) create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/_index.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/clickhouse/_index.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/clickhouse/query.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/hash/_index.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/hash/cityhash64.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/hash/sha256.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/hash/xxhash64.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/logql/_index.md create mode 100644 content/flux/v0.x/stdlib/contrib/qxip/logql/query_range.md create mode 100644 content/flux/v0.x/stdlib/experimental/geo/totaldistance.md create mode 100644 content/flux/v0.x/stdlib/experimental/iox/sqlinterval.md diff --git a/content/flux/v0.x/release-notes.md b/content/flux/v0.x/release-notes.md index 758b23d44..754d36f57 100644 --- a/content/flux/v0.x/release-notes.md +++ b/content/flux/v0.x/release-notes.md @@ -10,6 +10,27 @@ aliases: - /influxdb/cloud/reference/release-notes/flux/ --- +## v0.192.0 [2023-01-09] + +### Breaking changes +- Update iox.sql to detect midstream errors. + +### Features +- Add [`geo.totalDistance()`](/flux/v0.x/stdlib/experimental/geo/totaldistance/) + to aggregate total distance of consecutive points. +- Add [`iox.sqlInterval()`](/flux/v0.x/stdlib/experimental/iox/sqlinterval/) to + convert Flux durations to SQL interval strings. +- Add the [`contrib/qxip/hash`](/flux/v0.x/stdlib/contrib/qxip/hash/) package + which includes hashing functions. +- Add the [`contrib/qxip/logql`](/flux/v0.x/stdlib/contrib/qxip/logql/) package + which provides functions for working with + [Grafana Loki](https://grafana.com/oss/loki/) and [LogQL](https://grafana.com/docs/loki/latest/logql/). +- Add [`contrib/qxip/clickhouse`](/flux/v0.x/stdlib/contrib/qxip/clickhouse/) + package which provides functions for querying data from + [Clickhouse](https://clickhouse.com/). + +--- + ## v0.191.0 [2022-11-14] ### Features diff --git a/content/flux/v0.x/stdlib/contrib/qxip/_index.md b/content/flux/v0.x/stdlib/contrib/qxip/_index.md new file mode 100644 index 000000000..34153f5c8 --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/_index.md @@ -0,0 +1,36 @@ +--- +title: qxip package +description: > + The `qxip` package contains packages and functions contributed by [@qxip](https://github.com/qxip). +menu: + flux_0_x_ref: + name: qxip + parent: contrib + identifier: contrib/qxip +weight: 21 +--- + + + +The `qxip` package contains packages and functions contributed by [@qxip](https://github.com/qxip). + + + + +## Packages + +{{< children show="sections" >}} diff --git a/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/_index.md b/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/_index.md new file mode 100644 index 000000000..a1abd0aae --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/_index.md @@ -0,0 +1,56 @@ +--- +title: clickhouse package +description: > + The `clickhouse` package provides functions to query [ClickHouse](https://clickhouse.com/) using the ClickHouse HTTP API. +menu: + flux_0_x_ref: + name: clickhouse + parent: contrib/qxip + identifier: contrib/qxip/clickhouse +weight: 31 +cascade: + + introduced: 0.192.0 +--- + + + +The `clickhouse` package provides functions to query [ClickHouse](https://clickhouse.com/) using the ClickHouse HTTP API. +Import the `contrib/qxip/clickhouse` package: + +```js +import "contrib/qxip/clickhouse" +``` + + + +## Options + +```js +option clickhouse.defaultURL = "http://127.0.0.1:8123" +``` + +### defaultURL + +`defaultURL` is the default ClickHouse HTTP API URL. + + + + +## Functions + +{{< children type="functions" show="pages" >}} diff --git a/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/query.md b/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/query.md new file mode 100644 index 000000000..c04ca9b42 --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/clickhouse/query.md @@ -0,0 +1,100 @@ +--- +title: clickhouse.query() function +description: > + `clickhouse.query()` queries data from ClickHouse using specified parameters. +menu: + flux_0_x_ref: + name: clickhouse.query + parent: contrib/qxip/clickhouse + identifier: contrib/qxip/clickhouse/query +weight: 301 +flux/v0.x/tags: [inputs] +--- + + + +`clickhouse.query()` queries data from ClickHouse using specified parameters. + + + +##### Function type signature + +```js +( + query: string, + ?cors: string, + ?format: string, + ?limit: A, + ?max_bytes: B, + ?url: string, +) => stream[C] where A: Stringable, B: Stringable, C: Record +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### url + +ClickHouse HTTP API URL. Default is `http://127.0.0.1:8123`. + + + +### query +({{< req >}}) +ClickHouse query to execute. + + + +### limit + +Query rows limit. Defaults is `100`. + + + +### cors + +Request remote CORS headers. Defaults is `1`. + + + +### max_bytes + +Query bytes limit. Default is `10000000`. + + + +### format + +Query format. Default is `CSVWithNames`. + +_For information about available formats, see [ClickHouse formats](https://clickhouse.com/docs/en/interfaces/formats/)._ + + +## Examples + +### Query ClickHouse + +```js +import "contrib/qxip/clickhouse" + +option clickhouse.defaultURL = "https://play@play.clickhouse.com" + +clickhouse.query(query: "SELECT version()") + +``` + diff --git a/content/flux/v0.x/stdlib/contrib/qxip/hash/_index.md b/content/flux/v0.x/stdlib/contrib/qxip/hash/_index.md new file mode 100644 index 000000000..0179e74ad --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/hash/_index.md @@ -0,0 +1,44 @@ +--- +title: hash package +description: > + The `hash` package provides functions that convert string values to hashes. +menu: + flux_0_x_ref: + name: hash + parent: contrib/qxip + identifier: contrib/qxip/hash +weight: 31 +cascade: + + introduced: 0.192.0 +--- + + + +The `hash` package provides functions that convert string values to hashes. +Import the `contrib/qxip/hash` package: + +```js +import "contrib/qxip/hash" +``` + + + + +## Functions + +{{< children type="functions" show="pages" >}} diff --git a/content/flux/v0.x/stdlib/contrib/qxip/hash/cityhash64.md b/content/flux/v0.x/stdlib/contrib/qxip/hash/cityhash64.md new file mode 100644 index 000000000..8337bc2ea --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/hash/cityhash64.md @@ -0,0 +1,62 @@ +--- +title: hash.cityhash64() function +description: > + `hash.cityhash64()` converts a string value to a 64-bit hexadecimal hash using the CityHash64 algorithm. +menu: + flux_0_x_ref: + name: hash.cityhash64 + parent: contrib/qxip/hash + identifier: contrib/qxip/hash/cityhash64 +weight: 301 + +--- + + + +`hash.cityhash64()` converts a string value to a 64-bit hexadecimal hash using the CityHash64 algorithm. + + + +##### Function type signature + +```js +(v: A) => string +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### v +({{< req >}}) +String to hash. + + + + +## Examples + +### Convert a string to a 64-bit hash using CityHash64 + +```js +import "contrib/qxip/hash" + +hash.cityhash64(v: "Hello, world!")// Returns 2359500134450972198 + + +``` + diff --git a/content/flux/v0.x/stdlib/contrib/qxip/hash/sha256.md b/content/flux/v0.x/stdlib/contrib/qxip/hash/sha256.md new file mode 100644 index 000000000..91437ea00 --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/hash/sha256.md @@ -0,0 +1,64 @@ +--- +title: hash.sha256() function +description: > + `hash.sha256()` converts a string value to a hexadecimal hash using the SHA 256 hash algorithm. +menu: + flux_0_x_ref: + name: hash.sha256 + parent: contrib/qxip/hash + identifier: contrib/qxip/hash/sha256 +weight: 301 + +--- + + + +`hash.sha256()` converts a string value to a hexadecimal hash using the SHA 256 hash algorithm. + + + +##### Function type signature + +```js +(v: A) => string +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### v +({{< req >}}) +String to hash. + + + + +## Examples + +### Convert a string to a SHA 256 hash + +```js +import "contrib/qxip/hash" + +hash.sha256( + v: "Hello, world!", +)// Returns 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3 + + +``` + diff --git a/content/flux/v0.x/stdlib/contrib/qxip/hash/xxhash64.md b/content/flux/v0.x/stdlib/contrib/qxip/hash/xxhash64.md new file mode 100644 index 000000000..ffa09d61c --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/hash/xxhash64.md @@ -0,0 +1,62 @@ +--- +title: hash.xxhash64() function +description: > + `hash.xxhash64()` converts a string value to a 64-bit hexadecimal hash using the xxHash algorithm. +menu: + flux_0_x_ref: + name: hash.xxhash64 + parent: contrib/qxip/hash + identifier: contrib/qxip/hash/xxhash64 +weight: 301 + +--- + + + +`hash.xxhash64()` converts a string value to a 64-bit hexadecimal hash using the xxHash algorithm. + + + +##### Function type signature + +```js +(v: A) => string +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### v +({{< req >}}) +String to hash. + + + + +## Examples + +### Convert a string to 64-bit hash using xxHash + +```js +import "contrib/qxip/hash" + +hash.xxhash64(v: "Hello, world!")// Returns 17691043854468224118 + + +``` + diff --git a/content/flux/v0.x/stdlib/contrib/qxip/logql/_index.md b/content/flux/v0.x/stdlib/contrib/qxip/logql/_index.md new file mode 100644 index 000000000..5a700926d --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/logql/_index.md @@ -0,0 +1,64 @@ +--- +title: logql package +description: > + The `logql` package provides functions for using [LogQL](https://grafana.com/docs/loki/latest/logql/) to query a [Loki](https://grafana.com/oss/loki/) data source. +menu: + flux_0_x_ref: + name: logql + parent: contrib/qxip + identifier: contrib/qxip/logql +weight: 31 +cascade: + + introduced: 0.192.0 +--- + + + +The `logql` package provides functions for using [LogQL](https://grafana.com/docs/loki/latest/logql/) to query a [Loki](https://grafana.com/oss/loki/) data source. +Import the `contrib/qxip/logql` package: + +```js +import "contrib/qxip/logql" +``` + +The primary function in this package is `logql.query_range()` + +## Options + +```js +option logql.defaultAPI = "/loki/api/v1/query_range" + +option logql.defaultURL = "http://127.0.0.1:3100" +``` + +### defaultAPI + +`defaultAPI` is the default LogQL Query Range API Path. + + + +### defaultURL + +`defaultURL` is the default LogQL HTTP API URL. + + + + +## Functions + +{{< children type="functions" show="pages" >}} diff --git a/content/flux/v0.x/stdlib/contrib/qxip/logql/query_range.md b/content/flux/v0.x/stdlib/contrib/qxip/logql/query_range.md new file mode 100644 index 000000000..d8beb1298 --- /dev/null +++ b/content/flux/v0.x/stdlib/contrib/qxip/logql/query_range.md @@ -0,0 +1,122 @@ +--- +title: logql.query_range() function +description: > + `logql.query_range()` queries data from a specified LogQL query within given time bounds, + filters data by query, timerange, and optional limit expressions. + All values are returned as string values (using `raw` mode in `csv.from`) +menu: + flux_0_x_ref: + name: logql.query_range + parent: contrib/qxip/logql + identifier: contrib/qxip/logql/query_range +weight: 301 +flux/v0.x/tags: [inputs] +--- + + + +`logql.query_range()` queries data from a specified LogQL query within given time bounds, +filters data by query, timerange, and optional limit expressions. +All values are returned as string values (using `raw` mode in `csv.from`) + + + +##### Function type signature + +```js +( + query: string, + ?end: A, + ?limit: B, + ?orgid: string, + ?path: string, + ?start: C, + ?step: D, + ?url: string, +) => stream[E] where A: Timeable, B: Stringable, C: Timeable, D: Stringable, E: Record +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### url + +LogQL/qryn URL and port. Default is `http://qryn:3100`. + + + +### path + +LogQL query_range API path. + + + +### limit + +Query limit. Default is 100. + + + +### query +({{< req >}}) +LogQL query to execute. + + + +### start + +Earliest time to include in results. Default is `-1h`. + +Results include points that match the specified start time. +Use a relative duration or absolute time. +For example, `-1h` or `2022-01-01T22:00:00.801064Z`. + +### end + +Latest time to include in results. Default is `now()`. + +Results exclude points that match the specified stop time. +Use a relative duration or absolute time. +For example, `-1h` or `2022-01-01T22:00:00.801064Z`. + +### step + +Query resolution step width in seconds. Default is 10. + +Only applies to query types which produce a matrix response. + +### orgid + +Optional Loki organization ID for partitioning. Default is `""`. + + + + +## Examples + +### Query specific fields in a measurement from LogQL/qryn + +```js +import "contrib/qxip/logql" + +option logql.defaultURL = "http://qryn:3100" + +logql.query_range(query: "{job=\"dummy-server\"}", start: -1h, end: now(), limit: 100) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/geo/totaldistance.md b/content/flux/v0.x/stdlib/experimental/geo/totaldistance.md new file mode 100644 index 000000000..fe5624c7a --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/geo/totaldistance.md @@ -0,0 +1,154 @@ +--- +title: geo.totalDistance() function +description: > + `geo.totalDistance()` calculates the total distance covered by subsequent points + in each input table. +menu: + flux_0_x_ref: + name: geo.totalDistance + parent: experimental/geo + identifier: experimental/geo/totalDistance +weight: 201 +flux/v0.x/tags: [transformations, geotemporal, aggregates] +introduced: 0.192.0 +--- + + + +`geo.totalDistance()` calculates the total distance covered by subsequent points +in each input table. + +Each row must contain `lat` (latitude) and `lon` (longitude) columns that +represent the geographic coordinates of the point. +Row sort order determines the order in which distance between points is calculated. +Use the `geo.units` option to specify the unit of distance to return (default is km). + +##### Function type signature + +```js +(<-tables: stream[{B with lon: float, lat: float}], ?outputColumn: A) => stream[C] where C: Record +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### outputColumn + +Total distance output column. Default is `_value`. + + + +### tables + +Input data. Default is piped-forward data (`<-`). + + + + +## Examples + +- [Return the total distance travelled per input table](#return-the-total-distance-travelled-per-input-table) +- [Return the total distance travelled in miles](#return-the-total-distance-travelled-in-miles) + +### Return the total distance travelled per input table + +```js +import "experimental/geo" + +data + |> geo.totalDistance() + +``` + +{{< expand-wrapper >}} +{{% expand "View example input and output" %}} + +#### Input data + +| *id | _time | lat | lon | +| ---- | -------------------- | ---- | ---- | +| ABC1 | 2022-01-01T00:00:00Z | 85.1 | 42.2 | +| ABC1 | 2022-01-01T01:00:00Z | 71.3 | 50.8 | +| ABC1 | 2022-01-01T02:00:00Z | 63.1 | 62.3 | +| ABC1 | 2022-01-01T03:00:00Z | 50.6 | 74.9 | + +| *id | _time | lat | lon | +| ---- | -------------------- | ----- | ----- | +| DEF2 | 2022-01-01T00:00:00Z | -10.8 | -12.2 | +| DEF2 | 2022-01-01T01:00:00Z | -16.3 | -0.8 | +| DEF2 | 2022-01-01T02:00:00Z | -23.2 | 12.3 | +| DEF2 | 2022-01-01T03:00:00Z | -30.4 | 24.9 | + + +#### Output data + +| *id | _value | +| ---- | ----------------- | +| ABC1 | 4157.144498077607 | + +| *id | _value | +| ---- | ----------------- | +| DEF2 | 4428.129653320098 | + +{{% /expand %}} +{{< /expand-wrapper >}} + +### Return the total distance travelled in miles + +```js +import "experimental/geo" + +option geo.units = {distance: "mile"} + +data + |> geo.totalDistance() + +``` + +{{< expand-wrapper >}} +{{% expand "View example input and output" %}} + +#### Input data + +| *id | _time | lat | lon | +| ---- | -------------------- | ---- | ---- | +| ABC1 | 2022-01-01T00:00:00Z | 85.1 | 42.2 | +| ABC1 | 2022-01-01T01:00:00Z | 71.3 | 50.8 | +| ABC1 | 2022-01-01T02:00:00Z | 63.1 | 62.3 | +| ABC1 | 2022-01-01T03:00:00Z | 50.6 | 74.9 | + +| *id | _time | lat | lon | +| ---- | -------------------- | ----- | ----- | +| DEF2 | 2022-01-01T00:00:00Z | -10.8 | -12.2 | +| DEF2 | 2022-01-01T01:00:00Z | -16.3 | -0.8 | +| DEF2 | 2022-01-01T02:00:00Z | -23.2 | 12.3 | +| DEF2 | 2022-01-01T03:00:00Z | -30.4 | 24.9 | + + +#### Output data + +| *id | _value | +| ---- | ----------------- | +| ABC1 | 2583.129833073356 | + +| *id | _value | +| ---- | ------------------ | +| DEF2 | 2751.5122020650015 | + +{{% /expand %}} +{{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/experimental/http/requests/get.md b/content/flux/v0.x/stdlib/experimental/http/requests/get.md index 426207fe6..4895f6a6d 100644 --- a/content/flux/v0.x/stdlib/experimental/http/requests/get.md +++ b/content/flux/v0.x/stdlib/experimental/http/requests/get.md @@ -133,7 +133,7 @@ array.from(rows: [{name: data.name, age: data.age}]) | name | age | | --------- | ---- | -| nathaniel | 60 | +| nathaniel | 61 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/experimental/http/requests/peek.md b/content/flux/v0.x/stdlib/experimental/http/requests/peek.md index 3d1e2127e..7dd5e8d1a 100644 --- a/content/flux/v0.x/stdlib/experimental/http/requests/peek.md +++ b/content/flux/v0.x/stdlib/experimental/http/requests/peek.md @@ -80,7 +80,7 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name | body | duration | headers | statusCode | | ----------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | -| {"age":48,"count":25082,"name":"natalie"} | 100000000 | [ +| {"age":49,"count":25082,"name":"natalie"} | 100000000 | [ Access-Control-Allow-Credentials: true, Access-Control-Allow-Origin: *, Access-Control-Expose-Headers: x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset, @@ -88,12 +88,12 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name Connection: keep-alive, Content-Length: 41, Content-Type: application/json; charset=utf-8, - Date: Mon, 14 Nov 2022 23:13:24 GMT, + Date: Mon, 09 Jan 2023 22:05:46 GMT, Server: nginx/1.16.1, X-Rate-Limit-Limit: 1000, X-Rate-Limit-Remaining: 998, - X-Rate-Limit-Reset: 2796, - X-Request-Id: FyeWcih8QXW2sw8chtFh + X-Rate-Limit-Reset: 6854, + X-Request-Id: FzjDQTpxXJI494wvXynS ] | 200 | {{% /expand %}} diff --git a/content/flux/v0.x/stdlib/experimental/iox/from.md b/content/flux/v0.x/stdlib/experimental/iox/from.md index 03eeb3427..896818321 100644 --- a/content/flux/v0.x/stdlib/experimental/iox/from.md +++ b/content/flux/v0.x/stdlib/experimental/iox/from.md @@ -20,7 +20,7 @@ documentation is generated. To make updates to this documentation, update the function comments above the function definition in the Flux source code: -https://github.com/influxdata/flux/blob/master/stdlib/experimental/iox/iox.flux#L20-L20 +https://github.com/influxdata/flux/blob/master/stdlib/experimental/iox/iox.flux#L34-L34 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md @@ -55,3 +55,17 @@ Measurement to read data from. + +## Examples + +### Use Flux to query data from IOx + +```js +import "experimental/iox" + +iox.from(bucket: "example-bucket", measurement: "example-measurement") + |> range(start: -1d) + |> filter(fn: (r) => r._field == "example-field") + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/iox/sql.md b/content/flux/v0.x/stdlib/experimental/iox/sql.md index 1b92c8e4f..93b69a700 100644 --- a/content/flux/v0.x/stdlib/experimental/iox/sql.md +++ b/content/flux/v0.x/stdlib/experimental/iox/sql.md @@ -21,7 +21,7 @@ documentation is generated. To make updates to this documentation, update the function comments above the function definition in the Flux source code: -https://github.com/influxdata/flux/blob/master/stdlib/experimental/iox/iox.flux#L33-L33 +https://github.com/influxdata/flux/blob/master/stdlib/experimental/iox/iox.flux#L56-L56 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md @@ -50,7 +50,19 @@ IOx bucket to read data from. ### query ({{< req >}}) -Query to execute. +SQL query to execute. + +## Examples + +### Use SQL to query data from IOx + +```js +import "experimental/iox" + +iox.sql(bucket: "example-bucket", query: "SELECT * FROM measurement") + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/iox/sqlinterval.md b/content/flux/v0.x/stdlib/experimental/iox/sqlinterval.md new file mode 100644 index 000000000..6f1f57178 --- /dev/null +++ b/content/flux/v0.x/stdlib/experimental/iox/sqlinterval.md @@ -0,0 +1,93 @@ +--- +title: iox.sqlInterval() function +description: > + `iox.sqlInterval()` converts a duration value to a SQL interval string. +menu: + flux_0_x_ref: + name: iox.sqlInterval + parent: experimental/iox + identifier: experimental/iox/sqlInterval +weight: 201 +flux/v0.x/tags: [sql, type-conversions] +introduced: 0.192.0 +--- + + + +`iox.sqlInterval()` converts a duration value to a SQL interval string. + +SQL interval strings support down to millisecond precision. +Any microsecond or nanosecond duration units are dropped from the duration value. +If the duration only consists of microseconds or nanosecond units, +`iox.sqlInterval()` returns `1 millisecond`. +Duration values must be positive to work as a SQL interval string. + +##### Function type signature + +```js +(d: A) => string +``` + +{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}} + +## Parameters + +### d +({{< req >}}) +Duration value to convert to SQL interval string. + + + + +## Examples + +- [Convert a duration to a SQL interval](#convert-a-duration-to-a-sql-interval) +- [Use a Flux duration to define a SQL interval](#use-a-flux-duration-to-define-a-sql-interval) + +### Convert a duration to a SQL interval + +```js +import "experimental/iox" + +iox.sqlInterval( + d: 1y2mo3w4d5h6m7s8ms, +)// Returns 1 years 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds 8 milliseconds + + +``` + + +### Use a Flux duration to define a SQL interval + +```js +import "experimental/iox" + +windowInterval = 1d12h +sqlQuery = " +SELECT + DATE_BIN(INTERVAL '${iox.sqlInterval(d: windowInterval)}', time, TIMESTAMP '2023-01-01T00:00:00Z') + COUNT(field1) +FROM + measurement +GROUP BY + time +" + +iox.sql(bucket: "example-bucket", query: sqlQuery) + +``` + diff --git a/content/flux/v0.x/stdlib/experimental/json/parse.md b/content/flux/v0.x/stdlib/experimental/json/parse.md index 761358b00..9b8c5a01f 100644 --- a/content/flux/v0.x/stdlib/experimental/json/parse.md +++ b/content/flux/v0.x/stdlib/experimental/json/parse.md @@ -196,10 +196,10 @@ array.from( #### Output data -| id | color | pendingDuration | -| -------- | ------ | ---------------- | -| 15612462 | red | 3 | -| 15612462 | blue | 16 | +| color | pendingDuration | id | +| ------ | ---------------- | -------- | +| red | 3 | 15612462 | +| blue | 16 | 15612462 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/experimental/polyline/rdp.md b/content/flux/v0.x/stdlib/experimental/polyline/rdp.md index 1c47cf301..f363dba5a 100644 --- a/content/flux/v0.x/stdlib/experimental/polyline/rdp.md +++ b/content/flux/v0.x/stdlib/experimental/polyline/rdp.md @@ -107,44 +107,44 @@ data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:10:50Z | -29.76098586714259 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:00Z | -12.62058579127679 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:10Z | -29.76098586714259 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:20Z | -12.62058579127679 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | #### Output data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:10:50Z | -29.76098586714259 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:00Z | -12.62058579127679 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:10Z | -29.76098586714259 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:20Z | -12.62058579127679 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | {{% /expand %}} {{< /expand-wrapper >}} @@ -166,43 +166,43 @@ data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:10:50Z | -29.76098586714259 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:00Z | -12.62058579127679 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:10Z | -29.76098586714259 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:20Z | -12.62058579127679 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | #### Output data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:00Z | -12.62058579127679 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:20Z | -12.62058579127679 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | {{% /expand %}} {{< /expand-wrapper >}} @@ -224,42 +224,42 @@ data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:10:50Z | -29.76098586714259 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:00Z | -12.62058579127679 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:10Z | -29.76098586714259 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:20Z | -12.62058579127679 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | #### Output data | _time | _value | | -------------------- | ------------------- | -| 2022-11-14T23:10:40Z | 10.56555566168836 | -| 2022-11-14T23:11:00Z | -67.50435038579738 | -| 2022-11-14T23:11:10Z | -16.758669047964453 | -| 2022-11-14T23:11:20Z | -47.25865245658065 | -| 2022-11-14T23:11:30Z | 66.16082461651365 | -| 2022-11-14T23:11:40Z | -0.9179216017921821 | -| 2022-11-14T23:11:50Z | -56.89169240573004 | -| 2022-11-14T23:12:00Z | 11.358605472976624 | -| 2022-11-14T23:12:10Z | 28.71147881415803 | -| 2022-11-14T23:12:20Z | -30.928830759588756 | -| 2022-11-14T23:12:30Z | -22.411848631056067 | -| 2022-11-14T23:12:40Z | 17.05503606764129 | -| 2022-11-14T23:12:50Z | 9.834382683760559 | -| 2022-11-14T23:13:10Z | -44.44668391211515 | +| 2023-01-09T22:03:00Z | 10.56555566168836 | +| 2023-01-09T22:03:20Z | -67.50435038579738 | +| 2023-01-09T22:03:30Z | -16.758669047964453 | +| 2023-01-09T22:03:40Z | -47.25865245658065 | +| 2023-01-09T22:03:50Z | 66.16082461651365 | +| 2023-01-09T22:04:00Z | -0.9179216017921821 | +| 2023-01-09T22:04:10Z | -56.89169240573004 | +| 2023-01-09T22:04:20Z | 11.358605472976624 | +| 2023-01-09T22:04:30Z | 28.71147881415803 | +| 2023-01-09T22:04:40Z | -30.928830759588756 | +| 2023-01-09T22:04:50Z | -22.411848631056067 | +| 2023-01-09T22:05:00Z | 17.05503606764129 | +| 2023-01-09T22:05:10Z | 9.834382683760559 | +| 2023-01-09T22:05:30Z | -44.44668391211515 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/http/requests/get.md b/content/flux/v0.x/stdlib/http/requests/get.md index f5f9c6f1c..8813a7ffd 100644 --- a/content/flux/v0.x/stdlib/http/requests/get.md +++ b/content/flux/v0.x/stdlib/http/requests/get.md @@ -130,7 +130,7 @@ array.from(rows: [{name: data.name, age: data.age}]) | name | age | | --------- | ---- | -| nathaniel | 60 | +| nathaniel | 61 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/http/requests/peek.md b/content/flux/v0.x/stdlib/http/requests/peek.md index 5b85d531e..7edcc2d95 100644 --- a/content/flux/v0.x/stdlib/http/requests/peek.md +++ b/content/flux/v0.x/stdlib/http/requests/peek.md @@ -75,7 +75,7 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name | body | duration | headers | statusCode | | ----------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | -| {"age":48,"count":25082,"name":"natalie"} | 100000000 | [ +| {"age":49,"count":25082,"name":"natalie"} | 100000000 | [ Access-Control-Allow-Credentials: true, Access-Control-Allow-Origin: *, Access-Control-Expose-Headers: x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset, @@ -83,12 +83,12 @@ requests.peek(response: requests.get(url: "https://api.agify.io", params: ["name Connection: keep-alive, Content-Length: 41, Content-Type: application/json; charset=utf-8, - Date: Mon, 14 Nov 2022 23:13:25 GMT, + Date: Mon, 09 Jan 2023 22:05:48 GMT, Server: nginx/1.16.1, X-Rate-Limit-Limit: 1000, X-Rate-Limit-Remaining: 996, - X-Rate-Limit-Reset: 2795, - X-Request-Id: FyeWcoOFrZ49wQUaWluC + X-Rate-Limit-Reset: 6852, + X-Request-Id: FzjDQZ1EFfn5HmUxxygx ] | 200 | {{% /expand %}} diff --git a/content/flux/v0.x/stdlib/http/requests/post.md b/content/flux/v0.x/stdlib/http/requests/post.md index d1ff5dd73..cb952e80f 100644 --- a/content/flux/v0.x/stdlib/http/requests/post.md +++ b/content/flux/v0.x/stdlib/http/requests/post.md @@ -189,12 +189,12 @@ requests.peek(response: response) Cache-Control: max-age=604800, Content-Length: 1256, Content-Type: text/html; charset=UTF-8, - Date: Mon, 14 Nov 2022 23:13:26 GMT, + Date: Mon, 09 Jan 2023 22:05:48 GMT, Etag: "3147526947", - Expires: Mon, 21 Nov 2022 23:13:26 GMT, + Expires: Mon, 16 Jan 2023 22:05:48 GMT, Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT, Server: EOS (vny/0453) -] | 147996762 | +] | 92658873 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/universe/contains.md b/content/flux/v0.x/stdlib/universe/contains.md index 2471c1f24..cdde16fc4 100644 --- a/content/flux/v0.x/stdlib/universe/contains.md +++ b/content/flux/v0.x/stdlib/universe/contains.md @@ -72,13 +72,10 @@ data #### Input data -| _time | _value | *tag | *_field | _measurement | -| -------------------- | ------- | ---- | ------- | ------------- | -| 2021-01-01T00:00:00Z | -2 | t1 | f1 | m | -| 2021-01-01T00:00:50Z | 4 | t1 | f1 | m | - -| _time | _value | *tag | _measurement | *_field | -| ------ | ------- | ---- | ------------- | ------- | +| _time | _value | *tag | _measurement | *_field | +| -------------------- | ------- | ---- | ------------- | ------- | +| 2021-01-01T00:00:00Z | -2 | t1 | m | f1 | +| 2021-01-01T00:00:50Z | 4 | t1 | m | f1 | | _time | _value | *tag | _measurement | *_field | | -------------------- | ------- | ---- | ------------- | ------- | @@ -86,21 +83,15 @@ data | 2021-01-01T00:00:20Z | -3 | t2 | m | f1 | | 2021-01-01T00:00:50Z | 1 | t2 | m | f1 | -| _time | _value | *tag | *_field | _measurement | -| ------ | ------- | ---- | ------- | ------------- | +| _time | _value | *tag | _measurement | *_field | +| -------------------- | ------- | ---- | ------------- | ------- | +| 2021-01-01T00:00:10Z | 10 | t1 | m | f2 | +| 2021-01-01T00:00:20Z | 7 | t1 | m | f2 | -| _time | _value | *tag | *_field | _measurement | -| -------------------- | ------- | ---- | ------- | ------------- | -| 2021-01-01T00:00:10Z | 10 | t1 | f2 | m | -| 2021-01-01T00:00:20Z | 7 | t1 | f2 | m | - -| _time | _value | *tag | *_field | _measurement | -| -------------------- | ------- | ---- | ------- | ------------- | -| 2021-01-01T00:00:30Z | 17 | t1 | f3 | m | -| 2021-01-01T00:00:40Z | 15 | t1 | f3 | m | - -| _time | _value | *tag | _measurement | *_field | -| ------ | ------- | ---- | ------------- | ------- | +| _time | _value | *tag | _measurement | *_field | +| -------------------- | ------- | ---- | ------------- | ------- | +| 2021-01-01T00:00:30Z | 17 | t1 | m | f3 | +| 2021-01-01T00:00:40Z | 15 | t1 | m | f3 | | _time | _value | *tag | _measurement | *_field | | -------------------- | ------- | ---- | ------------- | ------- | @@ -111,13 +102,10 @@ data #### Output data -| _time | _value | *tag | *_field | _measurement | -| -------------------- | ------- | ---- | ------- | ------------- | -| 2021-01-01T00:00:00Z | -2 | t1 | f1 | m | -| 2021-01-01T00:00:50Z | 4 | t1 | f1 | m | - -| _time | _value | *tag | _measurement | *_field | -| ------ | ------- | ---- | ------------- | ------- | +| _time | _value | *tag | _measurement | *_field | +| -------------------- | ------- | ---- | ------------- | ------- | +| 2021-01-01T00:00:00Z | -2 | t1 | m | f1 | +| 2021-01-01T00:00:50Z | 4 | t1 | m | f1 | | _time | _value | *tag | _measurement | *_field | | -------------------- | ------- | ---- | ------------- | ------- | @@ -125,13 +113,10 @@ data | 2021-01-01T00:00:20Z | -3 | t2 | m | f1 | | 2021-01-01T00:00:50Z | 1 | t2 | m | f1 | -| _time | _value | *tag | *_field | _measurement | -| ------ | ------- | ---- | ------- | ------------- | - -| _time | _value | *tag | *_field | _measurement | -| -------------------- | ------- | ---- | ------- | ------------- | -| 2021-01-01T00:00:10Z | 10 | t1 | f2 | m | -| 2021-01-01T00:00:20Z | 7 | t1 | f2 | m | +| _time | _value | *tag | _measurement | *_field | +| -------------------- | ------- | ---- | ------------- | ------- | +| 2021-01-01T00:00:10Z | 10 | t1 | m | f2 | +| 2021-01-01T00:00:20Z | 7 | t1 | m | f2 | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/universe/covariance.md b/content/flux/v0.x/stdlib/universe/covariance.md index 775ce703c..2c8b147a4 100644 --- a/content/flux/v0.x/stdlib/universe/covariance.md +++ b/content/flux/v0.x/stdlib/universe/covariance.md @@ -82,13 +82,13 @@ data #### Input data -| _time | x | y | -| -------------------- | -- | ---- | -| 2021-01-01T00:00:00Z | 0 | 0 | -| 2021-01-01T00:00:12Z | 1 | 0.5 | -| 2021-01-01T00:00:24Z | 4 | 8 | -| 2021-01-01T00:00:36Z | 9 | 40.5 | -| 2021-01-01T00:00:48Z | 16 | 128 | +| y | _time | x | +| ---- | -------------------- | -- | +| 0 | 2021-01-01T00:00:00Z | 0 | +| 0.5 | 2021-01-01T00:00:12Z | 1 | +| 8 | 2021-01-01T00:00:24Z | 4 | +| 40.5 | 2021-01-01T00:00:36Z | 9 | +| 128 | 2021-01-01T00:00:48Z | 16 | #### Output data diff --git a/content/flux/v0.x/stdlib/universe/map.md b/content/flux/v0.x/stdlib/universe/map.md index 496cb82fc..cbc57ca96 100644 --- a/content/flux/v0.x/stdlib/universe/map.md +++ b/content/flux/v0.x/stdlib/universe/map.md @@ -193,20 +193,20 @@ sampledata.int() #### Output data -| alert | time | source | -| ------ | -------------------- | ------- | -| false | 2021-01-01T00:00:00Z | t1 | -| false | 2021-01-01T00:00:10Z | t1 | -| false | 2021-01-01T00:00:20Z | t1 | -| true | 2021-01-01T00:00:30Z | t1 | -| true | 2021-01-01T00:00:40Z | t1 | -| false | 2021-01-01T00:00:50Z | t1 | -| true | 2021-01-01T00:00:00Z | t2 | -| false | 2021-01-01T00:00:10Z | t2 | -| false | 2021-01-01T00:00:20Z | t2 | -| true | 2021-01-01T00:00:30Z | t2 | -| true | 2021-01-01T00:00:40Z | t2 | -| false | 2021-01-01T00:00:50Z | t2 | +| time | source | alert | +| -------------------- | ------- | ------ | +| 2021-01-01T00:00:00Z | t1 | false | +| 2021-01-01T00:00:10Z | t1 | false | +| 2021-01-01T00:00:20Z | t1 | false | +| 2021-01-01T00:00:30Z | t1 | true | +| 2021-01-01T00:00:40Z | t1 | true | +| 2021-01-01T00:00:50Z | t1 | false | +| 2021-01-01T00:00:00Z | t2 | true | +| 2021-01-01T00:00:10Z | t2 | false | +| 2021-01-01T00:00:20Z | t2 | false | +| 2021-01-01T00:00:30Z | t2 | true | +| 2021-01-01T00:00:40Z | t2 | true | +| 2021-01-01T00:00:50Z | t2 | false | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/content/flux/v0.x/stdlib/universe/union.md b/content/flux/v0.x/stdlib/universe/union.md index 41dce61b2..125a7c31c 100644 --- a/content/flux/v0.x/stdlib/universe/union.md +++ b/content/flux/v0.x/stdlib/universe/union.md @@ -149,14 +149,14 @@ union(tables: [t1, t2]) | _time | _value | tag | | -------------------- | ------- | ---- | -| 2021-01-01T00:00:00Z | 1 | foo | -| 2021-01-02T00:00:00Z | 2 | foo | -| 2021-01-03T00:00:00Z | 3 | foo | -| 2021-01-04T00:00:00Z | 4 | foo | | 2021-01-01T00:00:00Z | 0 | bar | | 2021-01-02T00:00:00Z | -1 | bar | | 2021-01-03T00:00:00Z | -2 | bar | | 2021-01-04T00:00:00Z | -3 | bar | +| 2021-01-01T00:00:00Z | 1 | foo | +| 2021-01-02T00:00:00Z | 2 | foo | +| 2021-01-03T00:00:00Z | 3 | foo | +| 2021-01-04T00:00:00Z | 4 | foo | {{% /expand %}} {{< /expand-wrapper >}} diff --git a/layouts/partials/article/flux-contrib.html b/layouts/partials/article/flux-contrib.html index 8f06e43e7..542db99ac 100644 --- a/layouts/partials/article/flux-contrib.html +++ b/layouts/partials/article/flux-contrib.html @@ -8,8 +8,7 @@

{{ $name | safeHTML }} is a user-contributed function maintained by - the package author and can - be updated or removed at any time. + the package author.

{{ else if eq .Kind "section" }} @@ -18,8 +17,7 @@ {{ $packageName := replaceRE `^(.*)( package)` "$1$2" $packageTitle }}

The {{ $packageName | safeHTML }} is a user-contributed package - maintained by the package author - and can be updated or removed at any time. + maintained by the package author.

{{ end }}