苦苦挣扎的SQL线

时间:2018-06-12 00:32:54

标签: mysql influxdb influxdb-python

我正在努力使用类似SQL的行,我只是不知道如何修复它。

Traceback (most recent call last):
  File "graph_influxdb.py", line 53, in <module>
    read_data(length='5min')
  File "graph_influxdb.py", line 29, in read_data
    result = client.query(query)
  File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 394, in query
    expected_response_code=expected_response_code
  File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 271, in request
    raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"error parsing query: found DCIX_OB, expected identifier at line 1, char 39"}

我在上一行中遇到以下错误:

{{1}}

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

  

Single quote string values (for example, tag values) but do not single quote identifiers (database names, retention policy names, user names, measurement names, tag keys, and field keys).

     

双引号标识符,如果它们以数字开头,包含[A-z,0-9,_]以外的字符,或者它们是InfluxQL关键字。标识符不需要双引号,如果它们不属于这些类别之一,但我们建议双重引用它们。

即。使用FROM "DCIX_OB"FROM DCIX_OB也是合法的,但不推荐使用。)