Merge pull request #664 from influxdata/flux-0.57

Flux 0.57
pull/669/head
Scott Anderson 2019-12-11 09:28:45 -07:00 committed by GitHub
commit aa6066eac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 94 additions and 8 deletions

View File

@ -24,6 +24,8 @@ bool(v: "true")
### v
The value to convert.
_**Data type:** Float | Integer | String | Uinteger_
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,8 @@ bytes(v: "1m")
### v
The value to convert.
_**Data type:** String_
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,13 @@ duration(v: "1m")
### v
The value to convert.
_**Data type:** Integer | String | Uinteger_
{{% note %}}
`duration()` assumes **numeric** input values are **nanoseconds**.
**String** input values must use [duration literal representation](#/v2.0/reference/flux/language/lexical-elements/#duration-literals).
{{% /note %}}
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,8 @@ float(v: "3.14")
### v
The value to convert.
_**Data type:** Boolean | Integer | Numeric String | Uinteger_
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,15 @@ int(v: "4")
### v
The value to convert.
_**Data type:** Boolean | Duration | Float | Numeric String | Time | Uinteger_
For duration and time values, `int()` returns the following:
| Input type | Returned value |
|:---------- |:-------------- |
| Duration | The number of nanoseconds in the specified duration |
| Time | A nanosecond epoch timestamp |
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,8 @@ string(v: 123456789)
### v
The value to convert.
_**Data type:** Boolean | Bytes | Duration | Float | Integer | Time | Uinteger_
## Examples
```js
from(bucket: "sensor-data")

View File

@ -24,6 +24,12 @@ time(v: "2016-06-13T17:43:50.1004002Z")
### v
The value to convert.
_**Data type:** Integer | String | Uinteger_
{{% note %}}
`time()` assumes all numeric input values are nanosecond epoch timestamps.
{{% /note %}}
## Examples
```js
from(bucket: "sensor-data")

View File

@ -14,12 +14,13 @@ weight: 501
The `toBool()` function converts all values in the `_value` column to booleans.
_**Function type:** Type conversion_
_**Output data type:** Boolean_
```js
toBool()
```
_**Supported data types:** Float | Integer | String | Uinteger_
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -18,12 +18,18 @@ weight: 501
The `toDuration()` function converts all values in the `_value` column to durations.
_**Function type:** Type conversion_
_**Output data type:** Duration_
```js
toDuration()
```
_**Supported data types:** Integer | String | Uinteger_
{{% note %}}
`duration()` assumes **numeric** input values are **nanoseconds**.
**String** input values must use [duration literal representation](#/v2.0/reference/flux/language/lexical-elements/#duration-literals).
{{% /note %}}
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -14,12 +14,13 @@ weight: 501
The `toFloat()` function converts all values in the `_value` column to floats.
_**Function type:** Type conversion_
_**Output data type:** Float_
```js
toFloat()
```
_**Supported data types:** Boolean | Integer | Numeric String | Uinteger_
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -14,12 +14,20 @@ weight: 501
The `toInt()` function converts all values in the `_value` column to integers.
_**Function type:** Type conversion_
_**Output data type:** Integer_
```js
toInt()
```
_**Supported data types:** Boolean | Duration | Float | Numeric String | Time | Uinteger_
For duration and time values, `toInt()` returns the following:
| Input type | Returned value |
|:---------- |:-------------- |
| Duration | The number of nanoseconds in the specified duration |
| Time | A nanosecond epoch timestamp |
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -14,12 +14,13 @@ weight: 501
The `toString()` function converts all values in the `_value` column to strings.
_**Function type:** Type conversion_
_**Output data type:** String_
```js
toString()
```
_**Supported data types:** Boolean | Bytes | Duration | Float | Integer | Time | Uinteger_
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -14,12 +14,17 @@ weight: 501
The `toTime()` function converts all values in the `_value` column to times.
_**Function type:** Type conversion_
_**Output data type:** Time_
```js
toTime()
```
_**Supported data types:** Integer | String | Uinteger_
{{% note %}}
`toTime()` assumes all numeric input values are nanosecond epoch timestamps.
{{% /note %}}
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -14,12 +14,20 @@ weight: 501
The `toUInt()` function converts all values in the `_value` column to UIntegers.
_**Function type:** Type conversion_
_**Output data type:** UInteger_
```js
toUInt()
```
_**Supported data types:** Boolean | Duration | Float | Integer | Numeric String | Time_
For duration and time values, `toUint()` returns the following:
| Input type | Returned value |
|:---------- |:-------------- |
| Duration | The number of nanoseconds in the specified duration |
| Time | A nanosecond epoch timestamp |
{{% note %}}
To convert values in a column other than `_value`, define a custom function
patterned after the [function definition](#function-definition),

View File

@ -24,6 +24,15 @@ uint(v: "4")
### v
The value to convert.
_**Data type:** Boolean | Duration | Float | Integer | Numeric String | Time_
For duration and time values, `uint()` returns the following:
| Input type | Returned value |
|:---------- |:-------------- |
| Duration | The number of nanoseconds in the specified duration |
| Time | A nanosecond epoch timestamp |
## Examples
```js
from(bucket: "sensor-data")

View File

@ -11,11 +11,28 @@ aliases:
---
{{% note %}}
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.55.1**.
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.57.0**.
Though newer versions of Flux may be available, they will not be included with
InfluxDB until the next InfluxDB v2.0 release._
{{% /note %}}
## v0.57.0 [2019-12-10]
### Features
- Categorize more flux errors with codes.
- Teach flux-config how to download the sources when using vendor.
- Opentracing in query execution runtime.
- Reduce memory allocations for operations in values.
- Translate FlatBuffers semantic graph to Go.
- Add types for some universe builtins.
- Add type declarations for builtins.
- Add Numeric and Row kind constraints.
### Bug fixes
- Enable strict mode by default.
---
## v0.56.0 [2019-12-05]
### Features