Skip to content

Throw exceptions in SqlValidator when DISTINCT used over WINDOW #16738

Merged
kgyrtkirk merged 9 commits intoapache:masterfrom
sreemanamala:count-dist
Jul 22, 2024
Merged

Throw exceptions in SqlValidator when DISTINCT used over WINDOW #16738
kgyrtkirk merged 9 commits intoapache:masterfrom
sreemanamala:count-dist

Conversation

@sreemanamala
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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