influxdata / influxdb-comparisons

Code for comparison write ups of InfluxDB and other solutions
MIT License
306 stars 112 forks source link

InfluxQL queries fail for 2.x #187

Closed codyshepherd closed 3 years ago

codyshepherd commented 3 years ago

Influxql queries generated by influxdb-comparisons currently fail during the benchmarking phase of performance tests of 2.x.

The queries are rejected, seemingly with an error stating that GETs should be POSTs. However, after some further debugging, this seems likely to be due to queries not being well-formed / updated to 2.x standards.

See comments in the following PR for more context and initial debugging attempts: https://github.com/influxdata/influxdb-comparisons/pull/181

codyshepherd commented 3 years ago

@danxmoran @wbaker85 I've speculatively tagged you bc I may not be able to get to this for a bit and figured with the perftest work you are both doing that you might stumble across this error sometime soon

williamhbaker commented 3 years ago

I've tried a little bit more to see if the api/v2/query endpoint works with InfluxQL queries. It isn't documented to work with anything other than Flux queries, and the docs recommend using the /query compatibility endpoint for InfluxQL.

Nevertheless, there is code in the api/v2/query handler that make it seem like it might/should work with an InfluxQL query. However, trying this with a relatively simple metaquery as a POST request with this body:

{
    "type": "influxql",
    "bucket": "benchmark_db",
    "query": "SHOW FIELD KEYS FROM \"example_measurement\" LIMIT 200"
}

I get the following error, which doesn't bode well for this working out:

{
    "code": "internal error",
    "message": "compilation failed: unknown statement type *influxql.ShowFieldKeysStatement"
}

I haven't tracked this down to exactly where the error originates (its somewhere within the query controller), but based on the fact that we have a working solution for InfluxQL on 2.x via the compatibility endpoint, I'm going to go ahead and close this issue for now.