apache / apache/druid

Support lambdas in json_merge function

Open
#17,284 7 comments 0 reactions 0 assignees View on GitHub
Contributions Welcome Feature/Change Description
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.