You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# show tag keys of measurement cpu
curl -G http://localhost:8086/query\?db\=mydb --data-urlencode "q=show tag keys from cpu"
expected: {"results":[{}]}
got: {"results":[{}]}
# show tag keys of measurement cpu in myrp2
curl -G http://localhost:8086/query\?db\=mydb --data-urlencode "q=show tag keys from mydb.myrp2.cpu"
expected: {"results":[{}]}
got: {"results":[{}]}
# show tag keys of measurement cpu in myrp1
curl -G http://localhost:8086/query\?db\=mydb --data-urlencode "q=show tag keys from mydb.myrp1.cpu"
expected: {"results":[{"series":[{"name":"cpu","columns":["tagKey"],"values":[["host"],["region"]]}]}]}
got: {"results":[{}]}
Additional info:
Query Log: All of the statements were rewrite to SELECT tagKey FROM mydb.myrp2._tagKeys WHERE _name = 'cpu'. It rewrite every source into default retention policy.
[query] 2016/04/27 20:18:22 SELECT tagKey FROM mydb.myrp2._tagKeys WHERE _name = 'cpu'
[httpd]2016/04/27 20:18:22 ::1 - - [27/Apr/2016:20:18:22 +0800] GET /query?db=mydb&q=show+tag+keys+from+mydb.myrp1.cpu HTTP/1.1 200 16 - curl/7.43.0 223a4a69-0c72-11e6-8008-000000000000 542.083µs
[query] 2016/04/27 20:18:28 SELECT tagKey FROM mydb.myrp2._tagKeys WHERE _name = 'cpu'
[httpd]2016/04/27 20:18:28 ::1 - - [27/Apr/2016:20:18:28 +0800] GET /query?db=mydb&q=show+tag+keys+from+mydb.myrp2.cpu HTTP/1.1 200 16 - curl/7.43.0 25ddf2af-0c72-11e6-8009-000000000000 378.017µs
[query] 2016/04/27 20:18:33 SELECT tagKey FROM mydb.myrp2._tagKeys WHERE _name = 'cpu'
[httpd]2016/04/27 20:18:33 ::1 - - [27/Apr/2016:20:18:33 +0800] GET /query?db=mydb&q=show+tag+keys+from+cpu HTTP/1.1 200 16 - curl/7.43.0 28d8e93c-0c72-11e6-800a-000000000000 630.81µs
The possible problem position in source code (in influxql/statement_rewriter.go line 157). I noticed that the previous statement's database & retention policy was discarded. But I don't know why? Are there any other considerations?
func rewriteShowTagKeysStatement(stmt *ShowTagKeysStatement) (Statement, error) {
// Check for time in WHERE clause (not supported).
if HasTimeExpr(stmt.Condition) {
return nil, errors.New("SHOW TAG KEYS doesn't support time in WHERE clause")
}
return &SelectStatement{
Fields: []*Field{
{Expr: &VarRef{Val: "tagKey"}},
},
Sources: []Source{
&Measurement{Name: "_tagKeys"}, // why not use previous statement's db and rp
},
Condition: rewriteSourcesCondition(stmt.Sources, stmt.Condition),
Offset: stmt.Offset,
Limit: stmt.Limit,
SortFields: stmt.SortFields,
OmitTime: true,
Dedupe: true,
}, nil
}
thx
The text was updated successfully, but these errors were encountered:
lvheyang
changed the title
Cannot Show Tag Keys
Cannot Show Tag Keys Except Default Retention Policy
Apr 27, 2016
lvheyang
changed the title
Cannot Show Tag Keys Except Default Retention Policy
Show Tag Keys Problem with Given Retention Policy
Apr 27, 2016
Bug report
System info: [InfluxDB 0.12.2, Mac OS X 10.11.4]
Steps to reproduce:
Expected behavior and Actual behavior
Additional info:
SELECT tagKey FROM mydb.myrp2._tagKeys WHERE _name = 'cpu'
. It rewrite every source into default retention policy.thx
The text was updated successfully, but these errors were encountered: