Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support retention policy to query and fix db problem when query db.rp.measurement #12

Merged
merged 5 commits into from
Jun 15, 2021

Conversation

shi0730
Copy link

@shi0730 shi0730 commented May 28, 2021

解决数据库名称加在表名前的情况
添加对保存策略操作的支持

解决数据库名称加在表名前的情况
添加对保存策略操作的支持
添加对保存策略操作的支持
添加对保存策略操作的支持
@chengshiwen chengshiwen changed the base branch from master to dev May 28, 2021 13:18
Copy link
Owner

@chengshiwen chengshiwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特别棒的贡献👍
如果能将中文注释换成英文则会更好😃

@@ -171,7 +175,8 @@ func GetMeasurementFromInfluxQL(q string) (m string, err error) {
}

func GetDatabaseFromTokens(tokens []string) (m string, err error) {
return GetIdentifierFromTokens(tokens, []string{"on", "database"}, getDatabase)
// 添加 from 解决数据库名称加在表名前的情况 by lyj
return GetIdentifierFromTokens(tokens, []string{"on", "database", "from"}, getDatabase)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

什么情况下会出现 数据库名称加在表名前的情况 呢

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

influxdb支持直接把数据库名加载表名前的查询.例如:SELECT mean("io_time") AS "mean_io_time" FROM "telegraf"."autogen"."diskio"

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为 from 的特殊性,后面可能是完整的 db.rp.measdb..meas的格式,也可能是单独 meas,所以为了确保这个修改足够覆盖所有的场景,可以增加下单元测试: https://github.com/chengshiwen/influx-proxy/blob/dev/backend/influxql_test.go

@chengshiwen chengshiwen mentioned this pull request Jun 2, 2021
@chengshiwen chengshiwen added this to the 2.6.0-release milestone Jun 2, 2021
@chengshiwen chengshiwen merged commit b9fbd07 into chengshiwen:dev Jun 15, 2021
@chengshiwen chengshiwen changed the title 202105 support retention policy to query and fix db problem when query db.rp.measurement Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants