chore: Update for Flux renaming
parent
188db01b19
commit
9fecaa0eb0
2
go.mod
2
go.mod
|
@ -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
4
go.sum
|
@ -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=
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -68,11 +68,11 @@ 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,
|
||||
Start: flux.Time{Absolute: tr.MinTime()},
|
||||
Stop: flux.Time{Absolute: tr.MaxTime()},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
}, from)
|
||||
|
||||
id := t.op("filter", &transformations.FilterOpSpec{
|
||||
|
|
|
@ -234,12 +234,12 @@ 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,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
}, cur.id)
|
||||
}
|
||||
return cur, nil
|
||||
|
|
|
@ -246,11 +246,11 @@ func (gr *groupInfo) createCursor(t *transpilerState) (cursor, error) {
|
|||
if interval > 0 {
|
||||
cur = &groupCursor{
|
||||
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,
|
||||
Every: flux.Duration(math.MaxInt64),
|
||||
Period: flux.Duration(math.MaxInt64),
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
}, cur.ID()),
|
||||
cursor: cur,
|
||||
}
|
||||
|
@ -371,11 +371,11 @@ func (gr *groupInfo) group(t *transpilerState, in cursor) (cursor, error) {
|
|||
|
||||
if windowEvery > 0 {
|
||||
windowOp := &transformations.WindowOpSpec{
|
||||
Every: flux.Duration(windowEvery),
|
||||
Period: flux.Duration(windowEvery),
|
||||
TimeCol: execute.DefaultTimeColLabel,
|
||||
StartColLabel: execute.DefaultStartColLabel,
|
||||
StopColLabel: execute.DefaultStopColLabel,
|
||||
Every: flux.Duration(windowEvery),
|
||||
Period: flux.Duration(windowEvery),
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
}
|
||||
|
||||
if !windowStart.IsZero() {
|
||||
|
|
|
@ -64,11 +64,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -122,8 +122,8 @@ func init() {
|
|||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -28,11 +28,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -112,8 +112,8 @@ func init() {
|
|||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -87,8 +87,8 @@ func init() {
|
|||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -31,11 +31,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: Now().Add(-10 * time.Minute)},
|
||||
Stop: flux.Time{Absolute: Now()},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -88,29 +88,29 @@ func init() {
|
|||
{
|
||||
ID: "window0",
|
||||
Spec: &transformations.WindowOpSpec{
|
||||
Every: flux.Duration(time.Minute),
|
||||
Period: flux.Duration(time.Minute),
|
||||
TimeCol: execute.DefaultTimeColLabel,
|
||||
StartColLabel: execute.DefaultStartColLabel,
|
||||
StopColLabel: execute.DefaultStopColLabel,
|
||||
Every: flux.Duration(time.Minute),
|
||||
Period: flux.Duration(time.Minute),
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
&aggregate,
|
||||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "window1",
|
||||
Spec: &transformations.WindowOpSpec{
|
||||
Every: flux.Duration(math.MaxInt64),
|
||||
Period: flux.Duration(math.MaxInt64),
|
||||
TimeCol: execute.DefaultTimeColLabel,
|
||||
StartColLabel: execute.DefaultStartColLabel,
|
||||
StopColLabel: execute.DefaultStopColLabel,
|
||||
Every: flux.Duration(math.MaxInt64),
|
||||
Period: flux.Duration(math.MaxInt64),
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -31,11 +31,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: Now().Add(-10 * time.Minute)},
|
||||
Stop: flux.Time{Absolute: Now()},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -88,30 +88,30 @@ func init() {
|
|||
{
|
||||
ID: "window0",
|
||||
Spec: &transformations.WindowOpSpec{
|
||||
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,
|
||||
Every: flux.Duration(5 * time.Minute),
|
||||
Period: flux.Duration(5 * time.Minute),
|
||||
Start: flux.Time{Absolute: time.Unix(0, 0).Add(time.Minute * 2)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
&aggregate,
|
||||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "window1",
|
||||
Spec: &transformations.WindowOpSpec{
|
||||
Every: flux.Duration(math.MaxInt64),
|
||||
Period: flux.Duration(math.MaxInt64),
|
||||
TimeCol: execute.DefaultTimeColLabel,
|
||||
StartColLabel: execute.DefaultStartColLabel,
|
||||
StopColLabel: execute.DefaultStopColLabel,
|
||||
Every: flux.Duration(math.MaxInt64),
|
||||
Period: flux.Duration(math.MaxInt64),
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -94,8 +94,8 @@ func init() {
|
|||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -107,11 +107,11 @@ func init() {
|
|||
{
|
||||
ID: "range1",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -172,14 +172,14 @@ func init() {
|
|||
{
|
||||
ID: "drop0",
|
||||
Spec: &transformations.DropOpSpec{
|
||||
Cols: []string{execute.DefaultTimeColLabel},
|
||||
Columns: []string{execute.DefaultTimeColLabel},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "duplicate1",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -94,8 +94,8 @@ func init() {
|
|||
{
|
||||
ID: "duplicate0",
|
||||
Spec: &transformations.DuplicateOpSpec{
|
||||
Col: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
Column: execute.DefaultStartColLabel,
|
||||
As: execute.DefaultTimeColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -150,11 +150,11 @@ func init() {
|
|||
{
|
||||
ID: "range1",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -30,11 +30,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -181,11 +181,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -29,11 +29,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -68,11 +68,11 @@ func init() {
|
|||
{
|
||||
ID: "range0",
|
||||
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,
|
||||
Start: flux.Time{Absolute: time.Unix(0, influxql.MinTime)},
|
||||
Stop: flux.Time{Absolute: time.Unix(0, influxql.MaxTime)},
|
||||
TimeColumn: execute.DefaultTimeColLabel,
|
||||
StartColumn: execute.DefaultStartColLabel,
|
||||
StopColumn: execute.DefaultStopColLabel,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue