java - InfluxDB Query issue when measurement name have hyphen in it -


i using java , querying influxdb shown below,

queryresult1 = influxdb.query(new query("select last(timestamp)  vale" , eachdatabase)); 

this statement working fine, when name have of special character e.g. if measurement name "vale-ab" instead of vale, won't work.

error getting is:

java.lang.runtimeexception: {"error":"error parsing query: found -, expected ; @ line 1, char 34"} 

any idea how can escape measurement name inside queries.

you need wrap measurement double quotes ".

bad:

select * a-b

err: error parsing query: found -, expected ; @ line 1, char 16

good:

select * "a-b"   name: a-b  time                tag1 value  ----                ---- -----  1434089562000000000 10i  5 

i don't have java installed on machine code below should solve problem.

queryresult1 = influxdb.query(new query("select last(timestamp)  \"vale-vale\"" , eachdatabase)); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -