apache / apache/pinot

lastwithtime() multiple column support

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

Description

Say a user has a table `t1` with 200+ columns `A`, `B`, `C0`…, `C200`. When the user runs `select max(A) from table group by B`, they get the max `A` for each `B`.

If they would like to get the corresponding `C0`, …, `C200` for each `max(A)` per `B` without aggregating on or grouping by the `C` columns, they need to do
```
select max(A), lastwithtime(C0, A, 'datatype'), ..., lastwithtime(C200, A, 'datatype') from table group by B
```
But applying `lastwithtime()` for each of the columns increases the latency significantly.

Is it possible to enhance `lastwithtime()` and support an arbitrary number of columns? For example,

```
select max(A), lastwithtime(A, array(C0, C1)) from table group by B
```
returns the associated values in `C0` and `C1` along with A.

And by default,

```
select max(A), lastwithtime(A) from table group by B
```
can return all the columns in the record for the matching value of A.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Begin by locating the existing lastwithtime() implementation and its aggregation tests, then determine how the proposed multi-column and default whole-record forms should be represented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.