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

Correct aggregators violating names #16615

Merged
merged 4 commits into from
Jul 12, 2024
Merged

Conversation

sreemanamala
Copy link
Contributor

@sreemanamala sreemanamala commented Jun 17, 2024

Description

In case of few aggregators for example BloomSqlAggregator, BaseVarianceSqlAggregator etc, the aggName is being updated from a0 to a0:agg, breaching the contract as we would expect the aggName as the name which is passed. This is causing a mismatch while creating a column accessor.

This commit aims to correct those violating sql aggregators.


Key changed/added classes in this PR
  • CompressedBigDecimalSqlAggregatorBase
  • TDigestGenerateSketchSqlAggregator
  • DoublesSketchObjectSqlAggregator
  • BloomFilterSqlAggregator
  • BaseVarianceSqlAggregator

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.

@kgyrtkirk
Copy link
Member

I think that change is the finalization stuff in action; how the finalization happens after these changes?

I'm not sure if forcing the column name would be the best - as for some reason the original aggfactory have decided to add a postagg - we can't really ignore that....if the base aggregate factory is not prepared to do the finalization implicitly then I guess that might go south...so I think we should probably look for some alternate path:

  • fix finalization support correctly
    • prefferably by moving the finalization to a separate project or something
    • create an autofinalized cover for the aggregates -
  • make it clear that these aggregators are not supported in windowing

@sreemanamala sreemanamala changed the title Fix window output column name for aggregators Correct aggregators violating names Jun 21, 2024
@pranavbhole
Copy link
Contributor

@kgyrtkirk can you please review the comments ?
Thank you

.queryContext(ImmutableMap.of(
PlannerContext.CTX_ENABLE_WINDOW_FNS, true,
QueryContexts.ENABLE_DEBUG, true,
QueryContexts.WINDOWING_STRICT_VALIDATION, false
Copy link
Member

Choose a reason for hiding this comment

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

this will break the other PR; so after one of these gets merged - to other needs updates

@kgyrtkirk kgyrtkirk merged commit eb981d8 into apache:master Jul 12, 2024
54 checks passed
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Aug 6, 2024
In case of few aggregators for example BloomSqlAggregator, BaseVarianceSqlAggregator etc, the aggName is being updated from a0 to a0:agg, breaching the contract as we would expect the aggName as the name which is passed. This is causing a mismatch while creating a column accessor.

This commit aims to correct those violating sql aggregators.
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