Commit dace8a7
authored
feat: add avg, max, min to allowed functions (#210)
### TL;DR
Added support for `avg`, `max`, and `min` functions to the allowed functions map.
### What changed?
Added three new entries to the `allowedFunctions` map in `internal/common/utils.go`:
- `avg`: for calculating averages
- `max`: for finding maximum values
- `min`: for finding minimum values
These functions join the existing allowed functions like `sum`, `count`, `reinterpretasuint256`, `reverse`, and `unhex`.
### How to test?
1. Use these newly added functions in queries or operations where allowed functions are checked
2. Verify that operations using `avg`, `max`, and `min` now execute successfully
3. Confirm that the functions perform their expected calculations correctly
### Why make this change?
These statistical functions are commonly needed for data analysis and aggregation operations. Adding them to the allowed functions map enables users to perform more sophisticated data processing without requiring custom implementations.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Expanded support for additional functions ("countDistinct", "avg", "max", "min") in query validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
0 commit comments