apache / apache/pinot

support EXPR_MIN/EXPR_MAX

Open
#11,254 0 comments 0 reactions 0 assignees View on GitHub
feature multi-stage
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
2d 55m
Merged PRs (30d)
182

Description

currently the ARG_MIN/ARG_MAX syntax added in #10636 isn't actually the latest supported operand type checker format in Calcite.

Namely, ` ARG_MIN/ARG_MAX(comp[, comp]*, value)` puts the mandatory value column at the end and the optional comparison in the middle. and incompatible with Calcite's syntax `ARG_MIN/ARG_MAX(value, comp)`

we propose to
1. use a new syntax `EXPR_MIN(value, comp[, comp]*) ` which is inline with `ARG_MIN/ARG_MAX(value, comp)` when no optional secondary comp columns are attached
2. migrate ARG_MIN/ARG_MAX to the new syntax and
3. [optional] if Calcite adopts the optional comp column we can further use `ARG_MIN`/`ARG_MAX` as synonym of `EXPR_MIN`/`EXPR_MAX` in the future.

CC @jasperjiaguo @Jackie-Jiang @xiangfu0

Contributor guide

Open the contributing guide

Research direction

Start by reviewing issue #10636 and the current ARG_MIN/ARG_MAX operand type-checker handling, then compare it with Calcite's ARG_MIN/ARG_MAX(value, comp) syntax. Done means supporting EXPR_MIN/EXPR_MAX(value, comp[, comp]*) and migrating ARG_MIN/ARG_MAX to that syntax, with any optional synonym work kept separate.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
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.