Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exceptions in SqlValidator when DISTINCT used over WINDOW #16738

Merged
merged 9 commits into from
Jul 22, 2024

Conversation

sreemanamala
Copy link
Contributor

@sreemanamala sreemanamala commented Jul 16, 2024

Description

  1. Throw exception if DISTINCT used with window functions aggregate call
  2. Improve error message when unsupported aggregations are used with window functions

Key changed/added classes in this PR
  • DruidSqlValidator
  • Windowing

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@sreemanamala sreemanamala marked this pull request as draft July 16, 2024 06:00
@sreemanamala sreemanamala marked this pull request as ready for review July 18, 2024 02:50
Comment on lines 215 to 220
if (rows.size() == numRows()) {
extraColumns.put(name, column);
columnNames.add(name);
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of removing it entirely - possibly a check would be nice to ensure that only columns which ColumnValueSwapper gets added like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made it check for instances of ObjectArrayColumn

@kgyrtkirk kgyrtkirk merged commit 149d7c5 into apache:master Jul 22, 2024
88 checks passed
@sreemanamala sreemanamala deleted the count-dist branch July 22, 2024 15:34
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Aug 6, 2024
…he#16738)

* Throw exception if DISTINCT used with window functions aggregate call
* Improve error message when unsupported aggregations are used with window functions
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants