How to extract json-object and count the value
- Dominant language
- Java
- Stars
- 6.1k
- Forks
- 1.5k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 189
Description
I have a json-type column in pinot like below:
`{"value1":1, "value2":2, "value3":3}`
`{"value1":2, "value4":4, "value5":1}`
`{"value2":3, "value3":1}`
now I just wanna extract the key and count the value of each key, the result is shown like below:
`"value1":3`
`"value2":5`
`"value3":4`
`"value4":4`
`"value5":1`
I mean there are more than 5 kinds of "values"(maybe value6, value7 ...) so how to write the corresponding sql ?
Contributor guide
Research direction
No file, test, or entry point is identified. Start by checking Pinot's SQL and JSON-column capabilities, especially whether keys can be enumerated dynamically; done means producing one result row per key with the summed value across all JSON objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100