emqx / emqx-docs

EMQX product documentation
https://docs.emqx.com/
155 stars 248 forks source link

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

Open xiaoxufeidao opened 1 year ago

xiaoxufeidao commented 1 year ago

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 commented 1 year ago

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

xiaoxufeidao commented 1 year ago

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

lafirest commented 1 year ago

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