Skip to content

Commit

Permalink
chore: upgrade to influxdata/influxql v1.2.0 (#24764)
Browse files Browse the repository at this point in the history
Upgrade to influxdata/influxql v1.2.0. While it does not fix any
known issues in InfluxDB OSS 1.x, it is necessary for upstream
projects impacted by influxdata/influxql#65.

In addition to upgrading influxdata/influxql, this also updates test
cases that relied on the erroneous precision handling when stringifying
InfluxQL ASTs.

Visible impacts to InfluxDB OSS 1.x:
- Changes precision of floating point numbers in error messages
  related to InfluxQL
- Changes precision of floating point numbers in "EXPLAIN" and
  "EXPLAIN ANALYZE" output
- Changes precision of floating point numbers from InfluxQL
  expressions included in tracing spans

closes: #24763
  • Loading branch information
gwossum authored and chengshiwen committed Aug 25, 2024
1 parent 977560b commit d2903fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/hashicorp/raft v1.3.11
github.com/hashicorp/raft-boltdb/v2 v2.2.2
github.com/influxdata/flux v0.65.1
github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385
github.com/influxdata/influxql v1.2.0
github.com/influxdata/pkg-config v0.2.11
github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368
Expand Down Expand Up @@ -119,4 +119,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/influxdata/influxql => github.com/influxtsdb/influxql v1.1.1-0.20220918111639-aa1802d18d78
replace github.com/influxdata/influxql => github.com/influxtsdb/influxql v1.1.1-0.20240810101344-3240ba2d3b01
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ github.com/influxdata/tdigest v0.0.2-0.20210216194612-fc98d27c9e8b h1:i44CesU68Z
github.com/influxdata/tdigest v0.0.2-0.20210216194612-fc98d27c9e8b/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y=
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368 h1:+TUUmaFa4YD1Q+7bH9o5NCHQGPMqZCYJiNW6lIIS9z4=
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po=
github.com/influxtsdb/influxql v1.1.1-0.20220918111639-aa1802d18d78 h1:t+2gF53w+YJ64tO9LAn2FKt4SkoyV0Or+6vqnh1/nxw=
github.com/influxtsdb/influxql v1.1.1-0.20220918111639-aa1802d18d78/go.mod h1:G79plbe6zxyKLhDgtKONDyBrbqqtNH2S4KBOpIs9sFk=
github.com/influxtsdb/influxql v1.1.1-0.20240810101344-3240ba2d3b01 h1:TjPKTbhsXKwYW/VHwJnjkkDRFPLORkuhYm0qqhI1e7w=
github.com/influxtsdb/influxql v1.1.1-0.20240810101344-3240ba2d3b01/go.mod h1:Yvn3qhVADvCGkXCggTQQ020meAG9W79AcYsstl21DX0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
Expand Down
4 changes: 2 additions & 2 deletions query/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ func TestCompile_Failures(t *testing.T) {
{s: `SELECT top(value) FROM cpu`, err: `invalid number of arguments for top, expected at least 2, got 1`},
{s: `SELECT top('unexpected', 5) FROM cpu`, err: `expected first argument to be a field in top(), found 'unexpected'`},
{s: `SELECT top(value, 'unexpected', 5) FROM cpu`, err: `only fields or tags are allowed in top(), found 'unexpected'`},
{s: `SELECT top(value, 2.5) FROM cpu`, err: `expected integer as last argument in top(), found 2.500`},
{s: `SELECT top(value, 2.5) FROM cpu`, err: `expected integer as last argument in top(), found 2.5`},
{s: `SELECT top(value, -1) FROM cpu`, err: `limit (-1) in top function must be at least 1`},
{s: `SELECT top(value, 3) FROM cpu LIMIT 2`, err: `limit (3) in top function can not be larger than the LIMIT (2) in the select statement`},
{s: `SELECT bottom(value) FROM cpu`, err: `invalid number of arguments for bottom, expected at least 2, got 1`},
{s: `SELECT bottom('unexpected', 5) FROM cpu`, err: `expected first argument to be a field in bottom(), found 'unexpected'`},
{s: `SELECT bottom(value, 'unexpected', 5) FROM cpu`, err: `only fields or tags are allowed in bottom(), found 'unexpected'`},
{s: `SELECT bottom(value, 2.5) FROM cpu`, err: `expected integer as last argument in bottom(), found 2.500`},
{s: `SELECT bottom(value, 2.5) FROM cpu`, err: `expected integer as last argument in bottom(), found 2.5`},
{s: `SELECT bottom(value, -1) FROM cpu`, err: `limit (-1) in bottom function must be at least 1`},
{s: `SELECT bottom(value, 3) FROM cpu LIMIT 2`, err: `limit (3) in bottom function can not be larger than the LIMIT (2) in the select statement`},
// TODO(jsternberg): This query is wrong, but we cannot enforce this because of previous behavior: https://github.com/influxdata/influxdb/pull/8771
Expand Down
2 changes: 1 addition & 1 deletion services/storage/predicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestRewriteExprRemoveFieldKeyAndValue(t *testing.T) {

expr, err := reads.NodeToExpr(node, nil)
assert.NoError(t, err, "NodeToExpr failed")
assert.Equal(t, expr.String(), `host::tag = 'host1' AND _field::tag =~ /^us-west/ AND "$" = 0.500`)
assert.Equal(t, expr.String(), `host::tag = 'host1' AND _field::tag =~ /^us-west/ AND "$" = 0.5`)

expr = storage.RewriteExprRemoveFieldKeyAndValue(expr)
assert.Equal(t, expr.String(), `host::tag = 'host1' AND true AND true`)
Expand Down

0 comments on commit d2903fd

Please sign in to comment.