diff --git a/go.mod b/go.mod index ec7528c4c3..01a7d98436 100644 --- a/go.mod +++ b/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 diff --git a/go.sum b/go.sum index 6969b219bb..d72de6bc6e 100644 --- a/go.sum +++ b/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= diff --git a/http/query_handler_test.go b/http/query_handler_test.go index 23d7c85688..956bc829c3 100644 --- a/http/query_handler_test.go +++ b/http/query_handler_test.go @@ -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, }, diff --git a/query/functions/inputs/from_test.go b/query/functions/inputs/from_test.go index 6459a8eb6c..21f17032a4 100644 --- a/query/functions/inputs/from_test.go +++ b/query/functions/inputs/from_test.go @@ -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", }, }, { diff --git a/query/influxql/cursor.go b/query/influxql/cursor.go index 2be21df6b0..5085929beb 100644 --- a/query/influxql/cursor.go +++ b/query/influxql/cursor.go @@ -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{ diff --git a/query/influxql/function.go b/query/influxql/function.go index 2a3f487282..06bc90457d 100644 --- a/query/influxql/function.go +++ b/query/influxql/function.go @@ -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 diff --git a/query/influxql/group.go b/query/influxql/group.go index 9ee91aab31..0342975c1f 100644 --- a/query/influxql/group.go +++ b/query/influxql/group.go @@ -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() { diff --git a/query/influxql/spectests/aggregates.go b/query/influxql/spectests/aggregates.go index 445e4c9899..ae517f33f0 100644 --- a/query/influxql/spectests/aggregates.go +++ b/query/influxql/spectests/aggregates.go @@ -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, }, }, { diff --git a/query/influxql/spectests/aggregates_with_condition.go b/query/influxql/spectests/aggregates_with_condition.go index 7f6b862fc2..6ce50155a1 100644 --- a/query/influxql/spectests/aggregates_with_condition.go +++ b/query/influxql/spectests/aggregates_with_condition.go @@ -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, }, }, { diff --git a/query/influxql/spectests/aggregates_with_groupby.go b/query/influxql/spectests/aggregates_with_groupby.go index 4eb8cddae5..c97e44efa1 100644 --- a/query/influxql/spectests/aggregates_with_groupby.go +++ b/query/influxql/spectests/aggregates_with_groupby.go @@ -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, }, }, { diff --git a/query/influxql/spectests/aggregates_with_window.go b/query/influxql/spectests/aggregates_with_window.go index b9fc350c24..14408a0069 100644 --- a/query/influxql/spectests/aggregates_with_window.go +++ b/query/influxql/spectests/aggregates_with_window.go @@ -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, }, }, { diff --git a/query/influxql/spectests/aggregates_with_window_offset.go b/query/influxql/spectests/aggregates_with_window_offset.go index b92b7a96b7..5df9b973c3 100644 --- a/query/influxql/spectests/aggregates_with_window_offset.go +++ b/query/influxql/spectests/aggregates_with_window_offset.go @@ -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, }, }, { diff --git a/query/influxql/spectests/multiple_aggregates.go b/query/influxql/spectests/multiple_aggregates.go index 33a7347497..c7e9cb78a3 100644 --- a/query/influxql/spectests/multiple_aggregates.go +++ b/query/influxql/spectests/multiple_aggregates.go @@ -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, }, }, { diff --git a/query/influxql/spectests/multiple_statements.go b/query/influxql/spectests/multiple_statements.go index 0907d1169f..cd51628e78 100644 --- a/query/influxql/spectests/multiple_statements.go +++ b/query/influxql/spectests/multiple_statements.go @@ -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, }, }, { diff --git a/query/influxql/spectests/raw.go b/query/influxql/spectests/raw.go index 19e8a592c7..99a419134d 100644 --- a/query/influxql/spectests/raw.go +++ b/query/influxql/spectests/raw.go @@ -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, }, }, { diff --git a/query/influxql/spectests/raw_with_condition.go b/query/influxql/spectests/raw_with_condition.go index d2ba8f6819..3981627bd2 100644 --- a/query/influxql/spectests/raw_with_condition.go +++ b/query/influxql/spectests/raw_with_condition.go @@ -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, }, }, { diff --git a/query/influxql/spectests/raw_with_regex_condition.go b/query/influxql/spectests/raw_with_regex_condition.go index 4dd67037ff..784a75f232 100644 --- a/query/influxql/spectests/raw_with_regex_condition.go +++ b/query/influxql/spectests/raw_with_regex_condition.go @@ -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, }, }, { diff --git a/query/influxql/spectests/retention_policy.go b/query/influxql/spectests/retention_policy.go index d0599951be..d7174dd0bc 100644 --- a/query/influxql/spectests/retention_policy.go +++ b/query/influxql/spectests/retention_policy.go @@ -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, }, }, { diff --git a/query/influxql/spectests/selectors.go b/query/influxql/spectests/selectors.go index af968f64d5..cda4374af8 100644 --- a/query/influxql/spectests/selectors.go +++ b/query/influxql/spectests/selectors.go @@ -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, }, }, { diff --git a/query/influxql/spectests/show_tag_values.go b/query/influxql/spectests/show_tag_values.go index 2c970e336b..c95d1ebe3b 100644 --- a/query/influxql/spectests/show_tag_values.go +++ b/query/influxql/spectests/show_tag_values.go @@ -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", }, diff --git a/query/influxql/spectests/show_tag_values_in_list.go b/query/influxql/spectests/show_tag_values_in_list.go index f1d088882a..559455ca6d 100644 --- a/query/influxql/spectests/show_tag_values_in_list.go +++ b/query/influxql/spectests/show_tag_values_in_list.go @@ -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", }, diff --git a/query/influxql/spectests/show_tag_values_multiple_measurements.go b/query/influxql/spectests/show_tag_values_multiple_measurements.go index 7b18abd626..d98950048b 100644 --- a/query/influxql/spectests/show_tag_values_multiple_measurements.go +++ b/query/influxql/spectests/show_tag_values_multiple_measurements.go @@ -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", }, diff --git a/query/influxql/transpiler.go b/query/influxql/transpiler.go index 48fbc2add7..bc2b16e27e 100644 --- a/query/influxql/transpiler.go +++ b/query/influxql/transpiler.go @@ -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", },