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

Latest aggregator factories should accept time as VectorValueSelecto… #14753

Merged

Conversation

somu-imply
Copy link
Contributor

@somu-imply somu-imply commented Aug 4, 2023

…r instead of BaseLongVectorValueSelector

Currently the existing factories were assuming that time would always be BaseLongVectorValueSelector. This would cause issues for queries during vectorization where the time can be an expression. For example

SELECT 
  LATEST_BY(num2, MILLIS_TO_TIMESTAMP(BITWISE_SHIFT_RIGHT(TIMESTAMP_TO_MILLIS(__time), 3)))
FROM "signals" GROUP BY TIME_FLOOR(__time, 'P1Y', null, 'America/New_York')

Error: Unknown exception

org.apache.druid.segment.virtual.ExpressionVectorValueSelector cannot be cast to org.apache.druid.segment.vector.BaseLongVectorValueSelector

java.lang.ClassCastException

This PR addresses the issue by removing BaseLongVectorValueSelector with the VectorValueSelector. The test case has also been added to our unit tests

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.

@somu-imply somu-imply changed the title Latest aggregator factorizes should accept time as VectorValueSelecto… Latest aggregator factories should accept time as VectorValueSelecto… Aug 4, 2023
Copy link
Contributor

@abhishekagarwal87 abhishekagarwal87 left a comment

Choose a reason for hiding this comment

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

some nits

somu-imply and others added 2 commits August 3, 2023 20:46
…t.java

Co-authored-by: Abhishek Agarwal <1477457+abhishekagarwal87@users.noreply.github.com>
…t.java

Co-authored-by: Abhishek Agarwal <1477457+abhishekagarwal87@users.noreply.github.com>
@abhishekagarwal87 abhishekagarwal87 merged commit 0d73480 into apache:master Aug 4, 2023
63 of 65 checks passed
@LakshSingla LakshSingla added this to the 28.0 milestone Oct 12, 2023
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.

4 participants