-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[0.9.3-rc2] Sum is returning 0 #3805
Comments
I am facing same problem with 0.9.2. also. I I have tried with group by clause also. is there anything that I am missing while querying data? |
Can you try that query with a time range? There might be a bug with aggregates against an exact time. Like: select sum(Downstream) from Usage where time >= '2015-07-23 01:07:08' and time < '2015-07-23 01:07:09' |
I have tried with time range, now() (with and without group by) but no luck. I was using 0.8.8. I just started migrating to 0.9. Please let me know if it is a bug or query is wrong. |
can you show the exact query and CLI output for the range queries you did? Also, what shows up if you just do the sum without specifying any time? |
There are values for Downstream,
|
I have run these queries on 0.9.2 release |
I tried several things to reproduce but no luck so far:
@buro1983 can you reproduce this on a new DB? If not, maybe it's a bug related to moving from one version to the next that I didn't hit in my simple tests. Any chance you could share your DB with us? If so, how large is it? |
raft.db will work for you? |
@buro1983 are you running a cluster or single node? We would need the contents of the data directory. In your influxdb config file...
Can you put it on a Google drive (or similar) and email the link to support@influxdb.com and ref this issue or post it here? |
Should probably just grab the whole |
I have sent DB details to support@influxdb.com |
@buro1983 is it possible you have been writing the values as strings and not numbers? The SUM of a string is always zero, and there's no easy way to tell from the output if it's stored as a number or a string. Can you share a sample write statement? |
UB and DB is declared as unit32. I have faced is problem on 0.9.3-rc2 then down graded to 0.9.2, I am not sure if it is a issue or problem from my side. But it did not work on both the versions. |
@buro1983 The UB and DB variables may be numbers in your code, but if they are double-quoted in the actual write submission they will be cast as strings by the database. This would be true for all 0.9 versions of the database. How are you writing points? A library, direct HTTP API calls? JSON protocol or line protocol? |
I am referring to ExampleClient_Write in https://github.com/influxdb/influxdb/blob/master/client/example_test.go I am writing everything into client.BatchPoints then using conn.Write() to write into DB. My code is same as mentioned in example. |
Influx log file contains traces like POST /write?consistency=&db=cs&precision=&rp=default HTTP/1.1 204 0 - InfluxDBClient 6680e80a-497d-11e5-8302-000000000000 1.220006ms |
@pauldix I just realized, the dates are identical. That should be impossible right?
|
nm, realized they are different series by doing a |
Ok, found the problem. The data is actually being written as a string. I added a panic that will fire if it isn't a valid type and got this result:
While this isn't a bug specifically because all the data is a string, we need to do a better job of catching and erring out the queries to end users. I opened an issue to here: #3818 |
Wait, I am using Influx client APIs to write into DB. My values are in integer then how it is getting stored as string? If it is expected then what I need to do to make sure that I am inserting integer values into DB instead of string.
Still it is not clear how interface.(type) is getting evaluated as string, where as actual value is unit32. |
Can you show me the definition for the |
Whole msg is getting parsed into this structure, after that I am storing into DB. |
Ok, there is a bug in the way we decode a |
Sum is returning 0 on 0.9.3-rc2 release. I am not able to understand why. Is there any problem with the query?
I am trying to sum up downstream values but I am getting 0
The text was updated successfully, but these errors were encountered: