emqx-docs icon indicating copy to clipboard operation
emqx-docs copied to clipboard

5.0版本sql规则INCASE对=号的判断是否存在bug

Open xiaoxufeidao opened this issue 2 years ago • 3 comments

File: /zh_CN/data-integration/rule-sql-syntax.md incase判断似乎存在bug,这样的sql无法在数据中提取出来数据,emqx 5.1.3 开源吧docker镜像中 过滤规则: FOREACH payload.devices DO payload.clientId as clientId, payload.timestamp as timestamp, payload.messageId as messageId, item.deviceId as deviceId, item.deviceData as deviceData INCASE item.deviceId="645_07_230422228799" from "dyiot_mqtt/dyiot_mqtt_g001/data_topic"

数据源: { "messageId": "315", "timestamp": 1690962870, "sn": "725101012218A5C3", "clientId": "dyiot_mqtt_g001", "version": "5.0", "gps": {}, "devices": [ { "deviceId": "645_07_230422228799", "deviceState": 1, "deviceData": { "PE": 0.55, "NE": 0, "PP": 0.0125, "NP": -0.0263, "UA": 224, "IA": 0.129 } } ] }

xiaoxufeidao avatar Aug 02 '23 09:08 xiaoxufeidao

在5.1.0和5.1.3的docker版本都存在相同无法过滤出来数据的问题

xiaoxufeidao avatar Aug 02 '23 09:08 xiaoxufeidao

item.deviceId="645_07_230422228799",字符串双引号""会影响判断,只能用单引号'', 即: item.deviceId='645_07_230422228799'

xiaoxufeidao avatar Aug 02 '23 09:08 xiaoxufeidao

@xiaoxufeidao Hi, this is the document repo, please report the issue here, https://github.com/emqx/emqx/issues, thanks

lafirest avatar Aug 09 '23 03:08 lafirest