chore: Update for Flux renaming

pull/10616/head
Nathaniel Cook 2018-11-05 11:49:01 -07:00
parent 188db01b19
commit 9fecaa0eb0
23 changed files with 152 additions and 150 deletions

2
go.mod
View File

@ -37,7 +37,7 @@ require (
github.com/hashicorp/raft v1.0.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/influxdata/flux v0.7.0-rc2
github.com/influxdata/flux v0.7.0-rc3
github.com/influxdata/influxdb v0.0.0-20181017211453-9520b8d95606
github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368

4
go.sum
View File

@ -120,8 +120,8 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/flux v0.7.0-rc2 h1:QpRjnoXCw4BIu+FeJ3Oek6eBXn12Nusn4nVB/7ubGss=
github.com/influxdata/flux v0.7.0-rc2/go.mod h1:wC5PBWVC/p7SQjKZNJ/dtwAuIufYHOVapzlC/A3awbQ=
github.com/influxdata/flux v0.7.0-rc3 h1:1sh+03udv1xGbD27U4y39MvnkQIS1UoDHT9dycqoe/0=
github.com/influxdata/flux v0.7.0-rc3/go.mod h1:wC5PBWVC/p7SQjKZNJ/dtwAuIufYHOVapzlC/A3awbQ=
github.com/influxdata/goreleaser v0.86.2-0.20181010170531-0fd209ba67f5/go.mod h1:aVuBpDAT5VtjtUxzvBt8HOd0buzvvk7OX3H2iaviixg=
github.com/influxdata/influxdb v0.0.0-20181017211453-9520b8d95606 h1:LBPg9NDkmVEGr22IrYPNsESFPjUnSgAbIgClv65dMIg=
github.com/influxdata/influxdb v0.0.0-20181017211453-9520b8d95606/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=

View File

@ -264,7 +264,7 @@ func TestFluxHandler_postFluxSpec(t *testing.T) {
w: httptest.NewRecorder(),
r: httptest.NewRequest("POST", "/api/v2/query/spec", bytes.NewBufferString(`{"query": "from(bucket:\"demo-bucket-in-1\") |> range(start:-2s) |> last()"}`)),
now: func() time.Time { return time.Unix(0, 0).UTC() },
want: `{"spec":{"operations":[{"kind":"from","id":"from0","spec":{"bucket":"demo-bucket-in-1"}},{"kind":"range","id":"range1","spec":{"start":"-2s","stop":"now","timeCol":"_time","startCol":"_start","stopCol":"_stop"}},{"kind":"last","id":"last2","spec":{"column":""}}],"edges":[{"parent":"from0","child":"range1"},{"parent":"range1","child":"last2"}],"resources":{"priority":"high","concurrency_quota":0,"memory_bytes_quota":0},"now":"1970-01-01T00:00:00Z"}}
want: `{"spec":{"operations":[{"kind":"from","id":"from0","spec":{"bucket":"demo-bucket-in-1"}},{"kind":"range","id":"range1","spec":{"start":"-2s","stop":"now","timeColumn":"_time","startColumn":"_start","stopColumn":"_stop"}},{"kind":"last","id":"last2","spec":{"column":""}}],"edges":[{"parent":"from0","child":"range1"},{"parent":"range1","child":"last2"}],"resources":{"priority":"high","concurrency_quota":0,"memory_bytes_quota":0},"now":"1970-01-01T00:00:00Z"}}
`,
status: http.StatusOK,
},
@ -301,7 +301,7 @@ func TestFluxHandler_postFluxPlan(t *testing.T) {
w: httptest.NewRecorder(),
r: httptest.NewRequest("POST", "/api/v2/query/plan", bytes.NewBufferString(`{"query": "from(bucket:\"telegraf\")|> range(start: -5000h)|> filter(fn: (r) => r._measurement == \"mem\" AND r._field == \"used_percent\")|> group(by:[\"host\"])|> mean()"}`)),
now: func() time.Time { return time.Unix(0, 0).UTC() },
want: `{"spec":{"operations":[{"kind":"from","id":"from0","spec":{"bucket":"telegraf"}},{"kind":"range","id":"range1","spec":{"start":"-5000h0m0s","stop":"now","timeCol":"_time","startCol":"_start","stopCol":"_stop"}},{"kind":"filter","id":"filter2","spec":{"fn":{"type":"FunctionExpression","block":{"type":"FunctionBlock","parameters":{"type":"FunctionParameters","list":[{"type":"FunctionParameter","key":{"type":"Identifier","name":"r"}}],"pipe":null},"body":{"type":"LogicalExpression","operator":"and","left":{"type":"BinaryExpression","operator":"==","left":{"type":"MemberExpression","object":{"type":"IdentifierExpression","name":"r"},"property":"_measurement"},"right":{"type":"StringLiteral","value":"mem"}},"right":{"type":"BinaryExpression","operator":"==","left":{"type":"MemberExpression","object":{"type":"IdentifierExpression","name":"r"},"property":"_field"},"right":{"type":"StringLiteral","value":"used_percent"}}}}}}},{"kind":"group","id":"group3","spec":{"by":["host"],"except":null,"all":false,"none":false}},{"kind":"mean","id":"mean4","spec":{"columns":["_value"]}}],"edges":[{"parent":"from0","child":"range1"},{"parent":"range1","child":"filter2"},{"parent":"filter2","child":"group3"},{"parent":"group3","child":"mean4"}],"resources":{"priority":"high","concurrency_quota":0,"memory_bytes_quota":0},"now":"1970-01-01T00:00:00Z"},"logical":{"roots":[{"Spec":{"Name":"_result"}}],"resources":{"priority":"high","concurrency_quota":1,"memory_bytes_quota":9223372036854775807},"now":"1970-01-01T00:00:00Z"},"physical":{"roots":[{"Spec":{"Name":"_result"}}],"resources":{"priority":"high","concurrency_quota":1,"memory_bytes_quota":9223372036854775807},"now":"1970-01-01T00:00:00Z"}}
want: `{"spec":{"operations":[{"kind":"from","id":"from0","spec":{"bucket":"telegraf"}},{"kind":"range","id":"range1","spec":{"start":"-5000h0m0s","stop":"now","timeColumn":"_time","startColumn":"_start","stopColumn":"_stop"}},{"kind":"filter","id":"filter2","spec":{"fn":{"type":"FunctionExpression","block":{"type":"FunctionBlock","parameters":{"type":"FunctionParameters","list":[{"type":"FunctionParameter","key":{"type":"Identifier","name":"r"}}],"pipe":null},"body":{"type":"LogicalExpression","operator":"and","left":{"type":"BinaryExpression","operator":"==","left":{"type":"MemberExpression","object":{"type":"IdentifierExpression","name":"r"},"property":"_measurement"},"right":{"type":"StringLiteral","value":"mem"}},"right":{"type":"BinaryExpression","operator":"==","left":{"type":"MemberExpression","object":{"type":"IdentifierExpression","name":"r"},"property":"_field"},"right":{"type":"StringLiteral","value":"used_percent"}}}}}}},{"kind":"group","id":"group3","spec":{"by":["host"],"except":null,"all":false,"none":false}},{"kind":"mean","id":"mean4","spec":{"columns":["_value"]}}],"edges":[{"parent":"from0","child":"range1"},{"parent":"range1","child":"filter2"},{"parent":"filter2","child":"group3"},{"parent":"group3","child":"mean4"}],"resources":{"priority":"high","concurrency_quota":0,"memory_bytes_quota":0},"now":"1970-01-01T00:00:00Z"},"logical":{"roots":[{"Spec":{"Name":"_result"}}],"resources":{"priority":"high","concurrency_quota":1,"memory_bytes_quota":9223372036854775807},"now":"1970-01-01T00:00:00Z"},"physical":{"roots":[{"Spec":{"Name":"_result"}}],"resources":{"priority":"high","concurrency_quota":1,"memory_bytes_quota":9223372036854775807},"now":"1970-01-01T00:00:00Z"}}
`,
status: http.StatusOK,
},

View File

@ -78,9 +78,9 @@ func TestFrom_NewQuery(t *testing.T) {
Relative: -2 * time.Hour,
IsRelative: true,
},
TimeCol: "_time",
StartCol: "_start",
StopCol: "_stop",
TimeColumn: "_time",
StartColumn: "_start",
StopColumn: "_stop",
},
},
{

View File

@ -70,9 +70,9 @@ func createVarRefCursor(t *transpilerState, ref *influxql.VarRef) (cursor, error
range_ := t.op("range", &transformations.RangeOpSpec{
Start: flux.Time{Absolute: tr.MinTime()},
Stop: flux.Time{Absolute: tr.MaxTime()},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
}, from)
id := t.op("filter", &transformations.FilterOpSpec{

View File

@ -234,11 +234,11 @@ func createFunctionCursor(t *transpilerState, call *influxql.Call, in cursor, no
if normalize {
if influxql.IsSelector(call) {
cur.id = t.op("drop", &transformations.DropOpSpec{
Cols: []string{execute.DefaultTimeColLabel},
Columns: []string{execute.DefaultTimeColLabel},
}, cur.id)
}
cur.id = t.op("duplicate", &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
}, cur.id)
}

View File

@ -248,9 +248,9 @@ func (gr *groupInfo) createCursor(t *transpilerState) (cursor, error) {
id: t.op("window", &transformations.WindowOpSpec{
Every: flux.Duration(math.MaxInt64),
Period: flux.Duration(math.MaxInt64),
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
}, cur.ID()),
cursor: cur,
}
@ -373,9 +373,9 @@ func (gr *groupInfo) group(t *transpilerState, in cursor) (cursor, error) {
windowOp := &transformations.WindowOpSpec{
Every: flux.Duration(windowEvery),
Period: flux.Duration(windowEvery),
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
}
if !windowStart.IsZero() {

View File

@ -66,9 +66,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -122,7 +122,7 @@ func init() {
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},

View File

@ -30,9 +30,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -112,7 +112,7 @@ func init() {
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -87,7 +87,7 @@ func init() {
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},

View File

@ -33,9 +33,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: Now().Add(-10 * time.Minute)},
Stop: flux.Time{Absolute: Now()},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -90,16 +90,16 @@ func init() {
Spec: &transformations.WindowOpSpec{
Every: flux.Duration(time.Minute),
Period: flux.Duration(time.Minute),
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
&aggregate,
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},
@ -108,9 +108,9 @@ func init() {
Spec: &transformations.WindowOpSpec{
Every: flux.Duration(math.MaxInt64),
Period: flux.Duration(math.MaxInt64),
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -33,9 +33,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: Now().Add(-10 * time.Minute)},
Stop: flux.Time{Absolute: Now()},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -91,16 +91,16 @@ func init() {
Every: flux.Duration(5 * time.Minute),
Period: flux.Duration(5 * time.Minute),
Start: flux.Time{Absolute: time.Unix(0, 0).Add(time.Minute * 2)},
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
&aggregate,
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},
@ -109,9 +109,9 @@ func init() {
Spec: &transformations.WindowOpSpec{
Every: flux.Duration(math.MaxInt64),
Period: flux.Duration(math.MaxInt64),
TimeCol: execute.DefaultTimeColLabel,
StartColLabel: execute.DefaultStartColLabel,
StopColLabel: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -94,7 +94,7 @@ func init() {
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},
@ -109,9 +109,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -172,13 +172,13 @@ func init() {
{
ID: "drop0",
Spec: &transformations.DropOpSpec{
Cols: []string{execute.DefaultTimeColLabel},
Columns: []string{execute.DefaultTimeColLabel},
},
},
{
ID: "duplicate1",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -94,7 +94,7 @@ func init() {
{
ID: "duplicate0",
Spec: &transformations.DuplicateOpSpec{
Col: execute.DefaultStartColLabel,
Column: execute.DefaultStartColLabel,
As: execute.DefaultTimeColLabel,
},
},
@ -152,9 +152,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -32,9 +32,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{
@ -183,9 +183,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -31,9 +31,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -70,9 +70,9 @@ func init() {
Spec: &transformations.RangeOpSpec{
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
TimeCol: execute.DefaultTimeColLabel,
StartCol: execute.DefaultStartColLabel,
StopCol: execute.DefaultStopColLabel,
TimeColumn: execute.DefaultTimeColLabel,
StartColumn: execute.DefaultStartColLabel,
StopColumn: execute.DefaultStopColLabel,
},
},
{

View File

@ -1,9 +1,10 @@
package spectests
import (
"time"
"github.com/influxdata/flux/functions/inputs"
"github.com/influxdata/flux/functions/transformations"
"time"
"github.com/influxdata/flux"
"github.com/influxdata/flux/execute"
@ -33,7 +34,7 @@ func init() {
{
ID: "keyValues0",
Spec: &transformations.KeyValuesOpSpec{
KeyCols: []string{"host"},
KeyColumns: []string{"host"},
},
},
{
@ -57,7 +58,7 @@ func init() {
{
ID: "rename0",
Spec: &transformations.RenameOpSpec{
Cols: map[string]string{
Columns: map[string]string{
"_key": "key",
"_value": "value",
},

View File

@ -1,9 +1,10 @@
package spectests
import (
"time"
"github.com/influxdata/flux/functions/inputs"
"github.com/influxdata/flux/functions/transformations"
"time"
"github.com/influxdata/flux"
"github.com/influxdata/flux/execute"
@ -33,7 +34,7 @@ func init() {
{
ID: "keyValues0",
Spec: &transformations.KeyValuesOpSpec{
KeyCols: []string{"host", "region"},
KeyColumns: []string{"host", "region"},
},
},
{
@ -57,7 +58,7 @@ func init() {
{
ID: "rename0",
Spec: &transformations.RenameOpSpec{
Cols: map[string]string{
Columns: map[string]string{
"_key": "key",
"_value": "value",
},

View File

@ -79,7 +79,7 @@ func init() {
{
ID: "keyValues0",
Spec: &transformations.KeyValuesOpSpec{
KeyCols: []string{"host"},
KeyColumns: []string{"host"},
},
},
{
@ -103,7 +103,7 @@ func init() {
{
ID: "rename0",
Spec: &transformations.RenameOpSpec{
Cols: map[string]string{
Columns: map[string]string{
"_key": "key",
"_value": "value",
},

View File

@ -173,11 +173,11 @@ func (t *transpilerState) transpileShowTagValues(ctx context.Context, stmt *infl
var keyValues transformations.KeyValuesOpSpec
switch expr := stmt.TagKeyExpr.(type) {
case *influxql.ListLiteral:
keyValues.KeyCols = expr.Vals
keyValues.KeyColumns = expr.Vals
case *influxql.StringLiteral:
switch stmt.Op {
case influxql.EQ:
keyValues.KeyCols = []string{expr.Val}
keyValues.KeyColumns = []string{expr.Val}
case influxql.NEQ, influxql.EQREGEX, influxql.NEQREGEX:
return "", fmt.Errorf("unimplemented: tag key operand: %s", stmt.Op)
default:
@ -191,7 +191,7 @@ func (t *transpilerState) transpileShowTagValues(ctx context.Context, stmt *infl
// Group by the measurement and key, find distinct values, then group by the measurement
// to join all of the different keys together. Finish by renaming the columns. This is static.
return t.op("rename", &transformations.RenameOpSpec{
Cols: map[string]string{
Columns: map[string]string{
"_key": "key",
"_value": "value",
},