From 4da32637edd0e74ccb384eaf96570bb60b2bb206 Mon Sep 17 00:00:00 2001 From: Paul Hummer Date: Mon, 12 Oct 2020 15:24:19 -0600 Subject: [PATCH] build(flux): update Flux to v0.89.0 --- cmd/influxd/launcher/query_test.go | 42 +++++++++++-------- go.mod | 6 +-- go.sum | 14 ++++--- query/control/controller.go | 2 +- query/stdlib/experimental/to.go | 1 + query/stdlib/influxdata/influxdb/rules.go | 2 +- .../stdlib/influxdata/influxdb/rules_test.go | 16 +++---- query/stdlib/influxdata/influxdb/source.go | 3 +- query/stdlib/influxdata/influxdb/to.go | 1 + query/stdlib/testing/testing.go | 5 ++- 10 files changed, 54 insertions(+), 38 deletions(-) diff --git a/cmd/influxd/launcher/query_test.go b/cmd/influxd/launcher/query_test.go index bc9653225ee..c8e98734491 100644 --- a/cmd/influxd/launcher/query_test.go +++ b/cmd/influxd/launcher/query_test.go @@ -753,7 +753,7 @@ from(bucket: "%s") } } -type TestQueryProfiler struct{ +type TestQueryProfiler struct { start int64 } @@ -777,62 +777,62 @@ func (s TestQueryProfiler) GetResult(q flux.Query, alloc *memory.Allocator) (flu colMeta := []flux.ColMeta{ { Label: "_measurement", - Type: flux.TString, + Type: flux.TString, }, { Label: "TotalDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "CompileDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "QueueDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "PlanDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "RequeueDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "ExecuteDuration", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "Concurrency", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "MaxAllocated", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "TotalAllocated", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "RuntimeErrors", - Type: flux.TString, + Type: flux.TString, }, { Label: "influxdb/scanned-bytes", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "influxdb/scanned-values", - Type: flux.TInt, + Type: flux.TInt, }, { Label: "flux/query-plan", - Type: flux.TString, + Type: flux.TString, }, } - colData := []interface{} { + colData := []interface{}{ fmt.Sprintf("profiler/query%d", s.start), s.start, s.start + 1, @@ -867,6 +867,14 @@ func (s TestQueryProfiler) GetResult(q flux.Query, alloc *memory.Allocator) (flu return tbl, nil } +func NewTestQueryProfiler0() execute.Profiler { + return &TestQueryProfiler{start: 0} +} + +func NewTestQueryProfiler100() execute.Profiler { + return &TestQueryProfiler{start: 100} +} + func TestFluxProfiler(t *testing.T) { testcases := []struct { name string @@ -903,7 +911,7 @@ error2","query plan",109,110 `, }, } - execute.RegisterProfilers(&TestQueryProfiler{}, &TestQueryProfiler{start: 100}) + execute.RegisterProfilerFactories(NewTestQueryProfiler0, NewTestQueryProfiler100) for _, tc := range testcases { tc := tc t.Run(tc.name, func(t *testing.T) { diff --git a/go.mod b/go.mod index 53aaa929648..9b8488b1ea1 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/NYTimes/gziphandler v1.0.1 github.com/RoaringBitmap/roaring v0.4.16 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 - github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db + github.com/apache/arrow/go/arrow v0.0.0-20200923215132-ac86123a3f01 github.com/benbjohnson/clock v0.0.0-20161215174838-7dc76406b6d3 github.com/benbjohnson/tmpl v1.0.0 github.com/boltdb/bolt v1.3.1 // indirect @@ -47,10 +47,10 @@ require ( github.com/hashicorp/vault/api v1.0.2 github.com/imdario/mergo v0.3.9 // indirect github.com/influxdata/cron v0.0.0-20191203200038-ded12750aac6 - github.com/influxdata/flux v0.83.3 + github.com/influxdata/flux v0.89.0 github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69 github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6 - github.com/influxdata/pkg-config v0.2.3 + github.com/influxdata/pkg-config v0.2.5 github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368 github.com/jessevdk/go-flags v1.4.0 github.com/jsternberg/zap-logfmt v1.2.0 diff --git a/go.sum b/go.sum index 5af1066288d..daa3aeaafdb 100644 --- a/go.sum +++ b/go.sum @@ -68,6 +68,8 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/RoaringBitmap/roaring v0.4.16 h1:NholfewybRLOwACgfqfzn/N5xa6keKNs4fP00t0cwLo= github.com/RoaringBitmap/roaring v0.4.16/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= +github.com/SAP/go-hdb v0.14.1 h1:hkw4ozGZ/i4eak7ZuGkY5e0hxiXFdNUBNhr4AvZVNFE= +github.com/SAP/go-hdb v0.14.1/go.mod h1:7fdQLVC2lER3urZLjZCm0AuMQfApof92n3aylBPEkMo= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -78,6 +80,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNg github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= +github.com/apache/arrow/go/arrow v0.0.0-20200923215132-ac86123a3f01 h1:FSqtT0UCktIlSU19mxj0YE5HK3HOO4IFMU9BpOif/7A= +github.com/apache/arrow/go/arrow v0.0.0-20200923215132-ac86123a3f01/go.mod h1:QNYViu/X0HXDHw7m3KXzWSVXIbfUvJqBFe6Gj8/pYA0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= @@ -317,20 +321,18 @@ github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/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/arrow/go/arrow v0.0.0-20200917142114-986e413c1705 h1:o8xdEcne0Mlrsggjz5Oxkj6cd2twn8mmJq5Gq5wZeD0= -github.com/influxdata/arrow/go/arrow v0.0.0-20200917142114-986e413c1705/go.mod h1:QNYViu/X0HXDHw7m3KXzWSVXIbfUvJqBFe6Gj8/pYA0= github.com/influxdata/cron v0.0.0-20191203200038-ded12750aac6 h1:OtjKkeWDjUbyMi82C7XXy7Tvm2LXMwiBBXyFIGNPaGA= github.com/influxdata/cron v0.0.0-20191203200038-ded12750aac6/go.mod h1:XabtPPW2qsCg0tl+kjaPU+cFS+CjQXEXbT1VJvHT4og= -github.com/influxdata/flux v0.83.3 h1:k+6XvZlV82tTNwoM3U9gTZ2W3C2S0Clr/t0bm86/4b0= -github.com/influxdata/flux v0.83.3/go.mod h1:+6FzHdZdwYjEIa2iuQEJ92x+C2A8X1jI0qdpVT0DJfM= +github.com/influxdata/flux v0.89.0 h1:aQ5A7E2vLJ0GT7zdH6+Of18QnXU8cc9pkz23zRluqY8= +github.com/influxdata/flux v0.89.0/go.mod h1:9csju6RUyFbwxcIR0Nyr8Z+fh2O4axq0zJE6DGHg1Cc= github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69 h1:WQsmW0fXO4ZE/lFGIE84G6rIV5SJN3P3sjIXAP1a8eU= github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA= github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6 h1:CFx+pP90q/qg3spoiZjf8donE4WpAdjeJfPOcoNqkWo= github.com/influxdata/influxql v0.0.0-20180925231337-1cbfca8e56b6/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/pkg-config v0.2.3 h1:2RcPxXST0N+wBudgjoL6yKYu93PvqN6mbLW0t+aakrg= -github.com/influxdata/pkg-config v0.2.3/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= +github.com/influxdata/pkg-config v0.2.5 h1:iC19aXlkUPiwxjxeeKk8TT8S5s3pargNPLgZE/rvOzc= +github.com/influxdata/pkg-config v0.2.5/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9 h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= diff --git a/query/control/controller.go b/query/control/controller.go index 0ec36252f22..559f0daff6a 100644 --- a/query/control/controller.go +++ b/query/control/controller.go @@ -211,7 +211,7 @@ func (c *Controller) Query(ctx context.Context, req *query.Request) (flux.Query, } // Add per-transformation spans if the feature flag is set. if feature.QueryTracing().Enabled(ctx) { - ctx = flux.WithExperimentalTracingEnabled(ctx) + ctx = flux.WithQueryTracingEnabled(ctx) } q, err := c.query(ctx, req.Compiler) if err != nil { diff --git a/query/stdlib/experimental/to.go b/query/stdlib/experimental/to.go index 3fa5a198aa1..e3d2b06c1aa 100644 --- a/query/stdlib/experimental/to.go +++ b/query/stdlib/experimental/to.go @@ -174,6 +174,7 @@ func createToTransformation(id execute.DatasetID, mode execute.AccumulationMode, // ToTransformation is the transformation for the `to` flux function. type ToTransformation struct { + execute.ExecutionNode ctx context.Context bucketID platform.ID orgID platform.ID diff --git a/query/stdlib/influxdata/influxdb/rules.go b/query/stdlib/influxdata/influxdb/rules.go index 69d9c46469e..7d3a60c30e9 100644 --- a/query/stdlib/influxdata/influxdb/rules.go +++ b/query/stdlib/influxdata/influxdb/rules.go @@ -851,7 +851,7 @@ func (PushDownWindowAggregateByTimeRule) Rewrite(ctx context.Context, pn plan.No } // window(every: inf) - if windowSpec.Window.Every != values.ConvertDuration(math.MaxInt64) || + if windowSpec.Window.Every != values.ConvertDurationNsecs(math.MaxInt64) || windowSpec.Window.Every != windowSpec.Window.Period || windowSpec.TimeColumn != execute.DefaultTimeColLabel || windowSpec.StartColumn != execute.DefaultStartColLabel || diff --git a/query/stdlib/influxdata/influxdb/rules_test.go b/query/stdlib/influxdata/influxdb/rules_test.go index 1398666ed58..e4c3d05e1da 100644 --- a/query/stdlib/influxdata/influxdb/rules_test.go +++ b/query/stdlib/influxdata/influxdb/rules_test.go @@ -1235,13 +1235,13 @@ func TestPushDownWindowAggregateRule(t *testing.T) { }, } - dur1m := values.ConvertDuration(60 * time.Second) - dur2m := values.ConvertDuration(120 * time.Second) - dur0 := values.ConvertDuration(0) + dur1m := values.ConvertDurationNsecs(60 * time.Second) + dur2m := values.ConvertDurationNsecs(120 * time.Second) + dur0 := values.ConvertDurationNsecs(0) durNeg, _ := values.ParseDuration("-60s") dur1mo, _ := values.ParseDuration("1mo") dur1y, _ := values.ParseDuration("1y") - durInf := values.ConvertDuration(math.MaxInt64) + durInf := values.ConvertDurationNsecs(math.MaxInt64) window := func(dur values.Duration) universe.WindowProcedureSpec { return universe.WindowProcedureSpec{ @@ -1996,12 +1996,12 @@ func TestTransposeGroupToWindowAggregateRule(t *testing.T) { return group(flux.GroupModeBy, keys...) } - dur1m := values.ConvertDuration(60 * time.Second) - dur2m := values.ConvertDuration(120 * time.Second) - dur0 := values.ConvertDuration(0) + dur1m := values.ConvertDurationNsecs(60 * time.Second) + dur2m := values.ConvertDurationNsecs(120 * time.Second) + dur0 := values.ConvertDurationNsecs(0) durNeg, _ := values.ParseDuration("-60s") dur1y, _ := values.ParseDuration("1y") - durInf := values.ConvertDuration(math.MaxInt64) + durInf := values.ConvertDurationNsecs(math.MaxInt64) window := func(dur values.Duration) universe.WindowProcedureSpec { return universe.WindowProcedureSpec{ diff --git a/query/stdlib/influxdata/influxdb/source.go b/query/stdlib/influxdata/influxdb/source.go index 87141898a1f..9e2facc6b38 100644 --- a/query/stdlib/influxdata/influxdb/source.go +++ b/query/stdlib/influxdata/influxdb/source.go @@ -30,6 +30,7 @@ type runner interface { } type Source struct { + execute.ExecutionNode id execute.DatasetID ts []execute.Transformation @@ -47,7 +48,7 @@ func (s *Source) Run(ctx context.Context) { labelValues := s.m.getLabelValues(ctx, s.orgID, s.op) start := time.Now() var err error - if flux.IsExperimentalTracingEnabled(ctx) { + if flux.IsQueryTracingEnabled(ctx) { span, ctxWithSpan := tracing.StartSpanFromContextWithOperationName(ctx, "source-"+s.op) err = s.runner.run(ctxWithSpan) span.Finish() diff --git a/query/stdlib/influxdata/influxdb/to.go b/query/stdlib/influxdata/influxdb/to.go index 62f07e5034c..b57adf2c5cc 100644 --- a/query/stdlib/influxdata/influxdb/to.go +++ b/query/stdlib/influxdata/influxdb/to.go @@ -257,6 +257,7 @@ func createToTransformation(id execute.DatasetID, mode execute.AccumulationMode, // ToTransformation is the transformation for the `to` flux function. type ToTransformation struct { + execute.ExecutionNode Ctx context.Context OrgID platform.ID BucketID platform.ID diff --git a/query/stdlib/testing/testing.go b/query/stdlib/testing/testing.go index 5ff37fe2c38..6b93357fba5 100644 --- a/query/stdlib/testing/testing.go +++ b/query/stdlib/testing/testing.go @@ -118,7 +118,7 @@ var FluxEndToEndSkipList = map[string]map[string]string{ "http": { "http_endpoint": "need ability to test side effects in e2e tests: (https://github.com/influxdata/flux/issues/1723)", }, - "influxdata/influxdb/v1": { + "influxdata/influxdb/schema": { "show_measurements": "flaky test (https://github.com/influxdata/influxdb/issues/15450)", "show_tag_values": "flaky test (https://github.com/influxdata/influxdb/issues/15450)", "show_tag_keys": "flaky test (https://github.com/influxdata/influxdb/issues/15450)", @@ -162,6 +162,9 @@ var FluxEndToEndSkipList = map[string]map[string]string{ "cumulative_sum": "invalid test data requires loadStorage to be overridden. See https://github.com/influxdata/flux/issues/3145", "elapsed": "failing since split with Flux upgrade: https://github.com/influxdata/influxdb/issues/19568", }, + "contrib/RohanSreerama5/naiveBayesClassifier": { + "bayes": "error calling tableFind: ", + }, } type PerTestFeatureFlagMap = map[string]map[string]map[string]string