gpt4 book ai didi

java - Siddhi 是否无法按多个变量进行分组?

转载 作者:行者123 更新时间:2023-12-02 04:13:05 26 4
gpt4 key购买 nike

我有以下流定义:

字符串事件流定义 =
“定义流cdrEventStream(nodeId字符串,电话字符串,timeStamp long,isOutgoingCall bool);”;

以及查询:

String query = "@info(name = 'query1') from cdrEventStream#window.externalTime(timeStamp,5 sec) 选择 nodeId、phone、timeStamp、isOutgoingCall、count(nodeId) 作为 callCount 组(按电话), isOutgoingCall 将所有事件插入到outputStream;";

但是当我尝试编译它们时,我得到:

org.wso2.siddhi.query.compiler.exception.SiddhiParserException: You have an error in your SiddhiQL at line 1:267, extraneous input ',' expecting {'#', STREAM, DEFINE, TABLE, FROM, PARTITION, WINDOW, SELECT, GROUP, BY, HAVING, INSERT, DELETE, UPDATE, RETURN, EVENTS, INTO, OUTPUT, EXPIRED, CURRENT, SNAPSHOT, FOR, RAW, OF, AS, OR, AND, ON, IS, NOT, WITHIN, WITH, BEGIN, END, NULL, EVERY, LAST, ALL, FIRST, JOIN, INNER, OUTER, RIGHT, LEFT, FULL, UNIDIRECTIONAL, YEARS, MONTHS, WEEKS, DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS, FALSE, TRUE, STRING, INT, LONG, FLOAT, DOUBLE, BOOL, OBJECT, ID_QUOTES, ID}
at org.wso2.siddhi.query.compiler.internal.SiddhiErrorListener.syntaxError(SiddhiErrorListener.java:34)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:65)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:558)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportUnwantedToken(DefaultErrorStrategy.java:377)
at org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:275)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.group_by(SiddhiQLParser.java:3783)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.query_section(SiddhiQLParser.java:3713)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.query(SiddhiQLParser.java:1903)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.execution_element(SiddhiQLParser.java:619)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.execution_plan(SiddhiQLParser.java:550)
at org.wso2.siddhi.query.compiler.SiddhiQLParser.parse(SiddhiQLParser.java:152)
at org.wso2.siddhi.query.compiler.SiddhiCompiler.parse(SiddhiCompiler.java:61)
at org.wso2.siddhi.core.SiddhiManager.createExecutionPlanRuntime(SiddhiManager.java:59)

编译查询的唯一方法是从 group by 子句中删除 isOutgoingCall 。 Siddhi 文档指出,按多个变量进行分组应该是可能的。这是一个错误吗?

这是版本 3.0.0-alpha。

最佳答案

Siddhi 3.0.0 支持按多个变量进行分组。我刚刚使用 Siddhi 3.0.0 检查了您的查询,并且能够编译它。当然,我使用的是 3.0.0 版本。您可以尝试一下吗?

提示:您可以使用Siddhi try it轻松尝试您的查询

关于java - Siddhi 是否无法按多个变量进行分组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33607649/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com