WSO2-DAS子串

WSO2-DAS子串,wso2,substr,wso2cep,wso2-das,siddhi,Wso2,Substr,Wso2cep,Wso2 Das,Siddhi,我目前正在使用siddhiql,我有一个简单的需求。 输入数据在报价中给出,例如 “苹果” 其结果是: 苹果 我试过使用 选择substr(inputDATA,1,4)作为outinsert-into-outputStream 比我得到的错误 "substr is neither a function nor an aggregated attribute, " 然而,我已经尝试在siddhi中使用JS来创建子字符串` 定义函数splitFn[JavaScript]返回字符串{} 但我得到了:

我目前正在使用siddhiql,我有一个简单的需求。 输入数据在报价中给出,例如

“苹果”

其结果是:

苹果

我试过使用

选择substr(inputDATA,1,4)作为outinsert-into-outputStream

比我得到的错误

"substr is neither a function nor an aggregated attribute, "
然而,我已经尝试在siddhi中使用JS来创建子字符串`

定义函数splitFn[JavaScript]返回字符串{}

但我得到了:

`jdk.nashorn.internal.runtime.ParserException: <eval>:1:22 Missing

 space after numeric literal var data = [""tempID=1wef"",0]`
`jdk.nashorn.internal.runtime.ParserException::1:22缺失
数值文字变量数据后面的空格=[“tempID=1wef”,0]`

你有没有其他的解决办法;或者我做错了什么

您必须将siddhi函数与名称空间一起使用

str:substr(inputDATA,1,4)
例如


请参阅以获取进一步参考

谢谢你的投入;我已经看过了文档,但仍然无法找出正确操作的实际方法。。。Thnkx again函数应该在“:(,…)”syntext中调用,您可以在那里找到所有的扩展名,这很好;正如我所说的,我也阅读了文档,但无法理解“名称空间”的含义。如果doc中有一个工作示例,我将非常有帮助。
select str:substr(inputDATA,1,4) as out insert into outputStream;