如何根据自定义条件在Clickhouse中拆分数组
当下一个元素小于上一个元素时,我正在尝试找到一种分裂数组的方法。这是一些示例数据
[100,200,500,100,150,200]
我需要将其转换为
[[100,200,500],[100,150,200]
我正在尝试计算数组的运行差,我需要处理计数器重置的情况,我们从0开始。我的想法是发生这种情况时,将数组分开,并在加入数组之前找出差异。
I am trying to find a way to split my array when the next element is smaller than the previous element. Here is some sample data
[100, 200, 500, 100, 150, 200]
I need to convert this to
[[100, 200, 500],[100, 150, 200]]
I am trying to calculate the running difference of the array and I need to handle the scenario where a counter resets and we start back at 0. My idea is to split the array when that happens and figure out the difference before joining the array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样的方式:
Try this way: