Support lambdas in json_merge function
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
### Description
The `json_merge` function would retain the rightmost key when the leaf elements have the same key. However, in some cases, you may want to aggregate the two results e.g. adding, multiplying, etc. If we can pass a lambda as an argument inside `json_merge`, we need not write custom json functions for doing such aggregations.
Contributor guide
Research direction
Start by locating the implementation and tests for the json_merge function in Apache Druid. Read how duplicate leaf keys currently select the rightmost value, then determine the lambda argument and aggregation behavior needed for cases such as addition or multiplication. Done means duplicate leaves can be combined through the supported lambda behavior and the relevant tests cover those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100