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

Parser works incorrectly with high-precision points #3054

Closed
Advoskr opened this issue Jun 19, 2015 · 8 comments
Closed

Parser works incorrectly with high-precision points #3054

Advoskr opened this issue Jun 19, 2015 · 8 comments

Comments

@Advoskr
Copy link

Advoskr commented Jun 19, 2015

Hi!

I'm new to InfluxDb and perform analysis on how to use this db engine in our project.

I currently face a very disgusting issue: when i try to write Double precision value to Db i get huge amount of columns which i didn't meant. For example, this HTTP request:

POST http://10.6.74.70:8086/write?u=root&p=root&db=netTestDb&time_precision=ms HTTP/1.1
User-Agent: InfluxDb.Net
Accept-Encoding: deflate
Content-Type: text/plain; charset=utf-8
Host: 10.6.74.70:8086
Content-Length: 808
Expect: 100-continue

MeasurementNet10 X=0.191052629701352,Y=0.852722118074411,T=0.906863938508026 101
MeasurementNet10 X=0.961525104922021,Y=0.888617412600954,T=0.770716769048347 102
MeasurementNet10 X=0.682256288678505,Y=0.796610517798276,T=0.231484161332009 103
MeasurementNet10 X=0.402903141641479,Y=0.642476850022784,T=0.600172209367236 104
MeasurementNet10 X=0.89336503292125,Y=0.553405792244433,T=0.304062585487991 105
MeasurementNet10 X=0.605175408350851,Y=0.270694734189052,T=0.632288566153631 106
MeasurementNet10 X=0.422191675017677,Y=0.435935292130306,T=0.56993827390016 107
MeasurementNet10 X=0.621569584878892,Y=0.587194737320391,T=0.350754068396405 108
MeasurementNet10 X=0.634489901659307,Y=0.0263585280749754,T=0.310414618491388 109
MeasurementNet10 X=0.651461392013105,Y=0.623513519588631,T=0.793712959528767 110

results in creating 1274 columns. Query select * from MeasurementNet10 limit 10 returns following JSON:

{  
   "results":[  
      {  
         "series":[  
            {  
               "name":"MeasurementNet10",
               "columns":[  
                  "time",
                  "0011779507627608",
                  "00164085207583422,Y",
                  "0020515057267861,Y",
                  "00533210439855797,Y",
                  "00879879622198585,Y",
                  "00959851453527739,T",
                  "00998993916902223,Y",
                  "0104352971587494,Y",
                  "0122137796190631,Y",
                  "0126514369680786,Y",
                  "0127815604269419,Y",
                  "0143174813195679,T",
                  "015039923607856",
                  "0152499703761423",
                  "016034455511735,T",
                  "0161105650552132",
                  "0180115876803229,Y",
                  "0189901413484431",
                  "0204541278166949,Y",
                  "021582078664369,Y",
                  "0222871019608747,Y",
                  "0241724108458368,Y",
                  "024625006608956,Y",
                  "0266947732431324,Y",
                  "0281805936378336,Y",
                  "0293763303334715",
                  "0301880040346589,T",
                  "0305972411439741,Y",
                  "0309916157419754,T",
                  "0310081918868274",
                  "0328753045913183",
                  "0341893718737128",
                  "0346249179144506",
                  "0353271505028602,Y",
                  "0358616574834388",
                  "0365816853179511,Y",
                  "0372902369300324,T",
                  "0374049265111819",
                  "0376476915728523,Y",
                  "0377267622564578,T",
                  "0377279524867087,Y",
                  "0384009746082132,Y",
                  "0389843383054176,T",
                  "0390534945945505,Y",
                  "0404405952619578,T",
                  "0405206610637348,T",
                  "0408780332845068,T",
                  "0419608042770814,Y",
                  "0422141622017204",
                  "0427698041511559,Y",
                  "0429770075916206,T",
                  "044194912092851",
                  "0456177252557211,Y",
                  "0465381155007231,Y",

and so on, i think you don't need full JSON to understand the problem.

So the question is: is this a bug, or a feature and what precision does Influx provide on floating point values?

@KiNgMaR
Copy link

KiNgMaR commented Jun 19, 2015

Your line protocol syntax is incorrect, please read #2696

@Advoskr
Copy link
Author

Advoskr commented Jun 19, 2015

@KiNgMaR Can you please explain what exactly is incorrect? I follow this patter:
measurement[,tag=value,tag2=value2...] field=value[,field2=value2...] [unixnano]
Thus, i get: MeasurementNet10 for measurement, no tags, three fields with Values(X,Y,T) and time in unixnano. What do i miss?

@beckettsean
Copy link
Contributor

@Advoskr you are providing a time_precision for the line protocol, which is known to lead to problems: #3044. The line protocol assumes all points are in nanosecond precision, but you provided millisecond precision in the query string.

Can you retry your writes without providing the time_precision parameter?

@Advoskr
Copy link
Author

Advoskr commented Jun 22, 2015

@beckettsean I have retried my tests without time_precision and it gave me nothing, i still face the same problem. Also, i tried less accurate point, ex. MeasurementNet10 X=0.49677,Y=0.41315,T=0.27501 12, but it also gives me this incorrect behaviour. Maybe i miss something?

@Advoskr
Copy link
Author

Advoskr commented Jun 22, 2015

@beckettsean I missed a thing. It seems that problem also corresponds to incorrect database deletion. My test performs delete database and create database before writes and it works. I also tried to drop database from web UI. Delete works, but data is incorrect (it doesn't wipe data about serie). When i used another database (newly-created) all worked fine (the data is ok). Also, there is no problem with floating point precision.
I still don't clearly understand how can i drop database correcly without harming meta or shards folders

@beckettsean
Copy link
Contributor

@Advoskr thanks for the additional information. It sounds like this is another report like those in #2916 and #3049. Does that seem correct to you?

@Advoskr
Copy link
Author

Advoskr commented Jun 23, 2015

@beckettsean thanks for your responses
Yes, they look very similar to what i faced. Also it'll be great to fix a problem with time_precision in line protocol. I have read your discussion on whether or not we need precision specification when speaking about UNIX epoch, but as far as epoch can be specified in ms or even s i find it usefull to support precision feature in line protocol also. Or, at least, ignore it totally, so that we cannot make such a mistake

@beckettsean
Copy link
Contributor

@Advoskr I think the write precision works fine with the line protocol, but the syntax is precision, not time_precision as appears in your initial curl example.

See the "Epoch and Precision" section on https://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html

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

No branches or pull requests

3 participants