Skip to content

Provide default implementation for RowFunction evalDimension method#15452

Merged
abhishekagarwal87 merged 5 commits intoapache:masterfrom
pagrawal10:pagrawal/modifyRowFunction
Jan 2, 2024
Merged

Provide default implementation for RowFunction evalDimension method#15452
abhishekagarwal87 merged 5 commits intoapache:masterfrom
pagrawal10:pagrawal/modifyRowFunction

Conversation

@pagrawal10
Copy link
Copy Markdown
Contributor

Description

The PR: #13947 introduced a function evalDimension() in the interface RowFunction.
There was no default implementation added for this interface which causes all the implementations and custom transforms to fail and require to implement their own version of evalDimension method. This PR adds a default implementation in the interface which allows the evalDimension to return value as a Singleton array of eval result.

Fixed the bug ...

#13947 is a breaking change for custom transform RowFunction implementations.

Renamed the class ...

None

Added a forbidden-apis entry ...

None

Release note

Default implementation for evalDimension method in RowFunction.


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

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.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

Sounds OK to me in concept.

Comment thread processing/src/main/java/org/apache/druid/segment/transform/RowFunction.java Outdated
@pagrawal10 pagrawal10 requested a review from gianm December 4, 2023 05:20
@Test
public void defaultEvalDimensionTest()
{
Row row = new Row()

Check warning

Code scanning / CodeQL

Inconsistent compareTo

This class declares [compareTo](1) but inherits equals; the two could be inconsistent.
@abhishekagarwal87 abhishekagarwal87 merged commit 8505e8a into apache:master Jan 2, 2024
@LakshSingla LakshSingla added this to the 29.0.0 milestone Jan 29, 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.

5 participants