apache / apache/pinot

MAX function should not cast to double, but instead keep original type

Open
#7,888 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
189

Description

When selecting a max of a large long, it truncates the result and loses precision.
For example:
`select MAX(1639054811930692679) from table` returns 1.63905481193069261E18, and loses precision.

Instead, the MAX function should return the original type. This should also apply to the other scalar aggregation functions.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the large-long MAX query described in the issue and trace the MAX aggregation implementation in Apache Pinot. Check the other scalar aggregation functions as well; done means MAX and the related functions preserve the original long type without truncation or precision loss.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
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.