saiswapnilar-stripe opened a new pull request, #20318: URL: https://github.com/apache/pinot/pull/20318
A query can compile successfully while a `GROUP BY` identifier resolves to an input column instead of a same-named `SELECT` alias. For example, `SELECT 'UNUSED' AS category, SUM(amount) FROM events GROUP BY category` can group by the underlying column rather than the constant, changing results after a Calcite upgrade. Add an opt-in `includeGroupByDiagnostics` field to batch compilation validation. For successful multi-stage compilations, return the overlapping identifier, its source position, matching SELECT expressions, and the expanded GROUP BY expression. The collector observes the same validator and catalog as compilation and does not alter the plan or reject queries. The response field is omitted when disabled. An empty overlap list means no observations were found; a null list means diagnostics were unavailable or inapplicable. Diagnostic failures discard observations without changing compilation results. The collector intentionally reports possible overlaps, including harmless same-column aliases, rather than claiming a correctness failure or exhaustive coverage. Preserve upstream's existing alias-precedence option, overlap meter, and validation error classification. This adds structured per-query observations alongside those mechanisms. Dependency: submit after the batch compilation validation endpoint lands, or review this branch against the endpoint branch to see only this feature's commit. Suggested labels: `feature`. Testing: `./mvnw -B -pl pinot-broker,pinot-controller -am -Dtest=PinotClientRequestTest,PinotQueryResourceStaticValidationTest,GroupByDiagnosticsTest -Dsurefire.failIfNoSpecifiedTests=false test` — 9 collector tests, 64 broker tests, and 2 controller tests passed. Affected-module formatting, checkstyle, and license checks passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
