[
https://issues.apache.org/jira/browse/IOTDB-635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17097954#comment-17097954
]
Xiangdong Huang commented on IOTDB-635:
---------------------------------------
+1 for "discrete"
How about :
discrete_data_function=AVG
continuous_data_function=LAST
> Downsample failed when the data type is Boolean in Grafana
> ----------------------------------------------------------
>
> Key: IOTDB-635
> URL: https://issues.apache.org/jira/browse/IOTDB-635
> Project: Apache IoTDB
> Issue Type: Bug
> Components: grafana
> Affects Versions: 0.9.2, 0.10.0-SNAPSHOT
> Reporter: Xiangdong Huang
> Assignee: Julian Feinauer
> Priority: Major
> Labels: pull-request-available
>
> Hi, issue IOTDB-528 introduced a good feature that downsampling data in
> iotdb-grafana connector.
> However, when a user defines the aggregation function as "AVG", there will be
> an exception if the user want to show Boolean data:
>
> {code:java}
> // code placeholder
> StatementCallback; uncategorized SQLException for SQL [SELECT avg(test) FROM
> root.root.org.pragmaticminds WHERE time > 1477895624866 and time <
> 1477917224866 group by (1m, [1477895624866, 1477917224866])]; SQL state
> [null]; error code [401]; Parsing error, statement [SELECT avg(test) FROM
> root.root.org.pragmaticminds WHERE time > 1477895624866 and time <
> 1477917224866 group by (1m, [1477895624866, 1477917224866])] failed when
> parsing AST tree to generate logical operator. Detailed information: [line
> 1:27 root is a key word. Please refer to SQL document and check whether it
> can be used here or not.]; nested exception is
> org.apache.iotdb.jdbc.IoTDBSQLException: Parsing error, statement [SELECT
> avg(test) FROM root.root.org.pragmaticminds WHERE time > 1477895624866 and
> time < 1477917224866 group by (1m, [1477895624866, 1477917224866])] failed
> when parsing AST tree to generate logical operator. Detailed information:
> [line 1:27 root is a key word. Please refer to SQL document and check whether
> it can be used here or not.]
> {code}
> (You can not say it is caused by that the user sets an incorrect parameter,
> becasue he/she may have many timeseries while some of the are int/float and
> others are boolean).
>
> As described in
> [http://iotdb.apache.org/UserGuide/V0.9.x/5-Operation%20Manual/4-SQL%20Reference.html#functions]
> , avg does not support boolean (and String I think).
> So, we have to handle cases like the above.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)