Comments (4)
Hi,
I'm not sure if I understand your text under "What did you expect to happen?". My guess is that you want bin2hexstr to pad the input with leading zeros until the size is divisible by 8 (padding until it is divisible by 4 should be enough) and then do the conversion?
I think bitstrings returned by subbits where the size is not divisible by 8 should not be outputed directly in the SQL. They should only be used as an intermediate data format in computations. At least this is what I think the TIP here https://www.emqx.io/docs/en/latest/data-integration/rule-sql-builtin-functions.html#bit-sequence-functions tries to explain.
Maybe it is enough to extend bin2hexstr so it accepts all bitstrings?
from emqx.
I made a PR that updates bin2hexstr to handle all bitstrings:
Do you think we should also handle when the rule output fields with bitstrings with a bit size that is not divisible by 8? I think it was not a good design to allow such bitstrings as return values from subbits (it creates a lot of complication and probably not so much value) but I guess we are stuck with it now...
from emqx.
Extending bin2hexstr is a good idea.
However, I'm not sure it makes sense that the output of some functions cannot be directly used as input to JSON, despite the additional instructions given in the documentation.
This breaks some convention and makes me unsure if there will be more functions like this.
from emqx.
However, I'm not sure it makes sense that the output of some functions cannot be directly used as input to JSON, despite the additional instructions given in the documentation.
I agree, but that function already exists so I'm not sure that we can change it. Is there any way users could use it so that it outputs a binary with a bit size not divisible by 8 and not cause a crash? If not, maybe it is not too late to change it to no allow such outputs? If we can restrict it, I think that would be the best.
from emqx.
Related Issues (20)
- Broker doesn't send PUBLISH to QUIC client until QUIC client sends keepalive HOT 8
- client is in endless online and offline switching
- 共享订阅客户端主动断开连接后,`emqx`仍然会向离线的客户端推送消息,导致消息顺序错乱 HOT 2
- Unable to login the dashboard HOT 9
- 为什么不提供windows版下载 HOT 2
- JWKS SSL opts in per-listener authentication not applied correctly in EMQX 5.7.1+ HOT 5
- Auto subscribe based on client id pattern HOT 4
- 管理端访问 主题 带 / 的功能时报错 HOT 2
- Emqx manual clustering fail when windows emqx broker attempting to join the linux broker HOT 4
- AWK not found in docker HOT 3
- cannot pass parameters in connector with url or path HOT 5
- closed HOT 1
- Add option to configure pod labels via Helm Chart HOT 3
- The is_superuser field set by the JWT authenticator is invalid. HOT 2
- emqx crashing on startup after upgrade to 5.8.0 HOT 12
- websocket terminated due to fail in matching function HOT 7
- Node Crash Continuously in a Cluster of 3 Nodes Due to emqx_dashboard_listener Failure HOT 2
- The 5.8.0 version of emqx crashes upon startup HOT 2
- The webhook page doesn't work when accessing emqx's web panel through a reverse proxy HOT 19
- Confusing response message when publishing message to a denied topic HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emqx.