Commit Graph

260 Commits

Author SHA1 Message Date
Shawn 86d20b060c fix(metrics): counters not created before incr 'rule.matched' 2020-12-22 11:18:16 +08:00
Shawn c3159420bb feat(funcs): add bitsize/1 and subbits/2,3,6 functions 2020-12-22 11:18:16 +08:00
Shawn e72cbd22c4 fix(rule_validator): fill default values when validating the params 2020-12-18 11:08:17 +08:00
Shawn 0a44270932
* fix(dialyzer): remove the dialyzer errors 2020-12-17 10:04:49 +08:00
Shawn 10dbb5bc96
Fix testcases warns (#3906) 2020-12-11 18:54:48 +08:00
Zaiming Shi 3a91ff8a7b chore(proj): resync apps 2020-12-11 08:19:26 +01:00
Shawn 15d048d8ec feat(funcs): add bitsize/1 and subbits/2,3,6 functions
Given following Rule SQL:

```
select
  subbits(payload, 1, 8) as firstByte,
  case
    when firstByte = 123 then 't/{'
    when firstByte = 125 then 't/}'
    else 't/' + str(firstByte)
  end as tp
from "t/#"
```

Input Payload: `{x}`
Output: `{"tp": "t/{", "firstByte": 123}`

Input Payload: `}x`
Output: `{"tp": "t/}", "firstByte": 125}`

Input Payload: `a`
Output: `{"tp": "t/97", "firstByte": 97}`
2020-12-10 11:26:07 +08:00
Shawn 573a4b2df8 chore(rule_engine): sync the code from rule-engine/dev/v4.3.0 2020-12-09 17:58:26 +08:00
Zaiming Shi 2fda0a1565 chore(apps): Sync again all apps 2020-12-07 21:30:21 +01:00
Zaiming Shi 686c006d6e refactor(proj): Add apps 2020-12-04 22:11:53 +01:00