Skip to content

Add serde for ColumnBasedRowsAndColumns to fix window queries without group by#16658

Merged
kgyrtkirk merged 29 commits intoapache:masterfrom
sreemanamala:window-fix-nontransferable
Sep 17, 2024
Merged

Add serde for ColumnBasedRowsAndColumns to fix window queries without group by#16658
kgyrtkirk merged 29 commits intoapache:masterfrom
sreemanamala:window-fix-nontransferable

Conversation

@sreemanamala
Copy link
Copy Markdown
Contributor

@sreemanamala sreemanamala commented Jun 26, 2024

Description

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.


Key changed/added classes in this PR
  • RowsAndColumns
  • FrameRowsAndColumns
  • DruidDefaultSerializersModule

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 June 26, 2024 05:37
@sreemanamala sreemanamala marked this pull request as ready for review June 26, 2024 15:00
Comment thread sql/src/test/resources/calcite/tests/window/simpleSum.sqlTest Outdated
@sreemanamala sreemanamala reopened this Jul 22, 2024
@sreemanamala sreemanamala requested a review from kgyrtkirk July 22, 2024 04:59
@sreemanamala sreemanamala marked this pull request as draft July 22, 2024 04:59
@sreemanamala sreemanamala marked this pull request as ready for review July 25, 2024 05:27
Comment on lines +162 to +163
false,
ByteBuffer.allocate(Frame.compressionBufferSize((int) frame.numBytes())),
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.

compression is false; meanwhile a compressionBuffer is being allocated at every call - is that required?
if its needed - would it be possible to reuse the buffer later?

Copy link
Copy Markdown
Contributor Author

@sreemanamala sreemanamala Sep 8, 2024

Choose a reason for hiding this comment

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

Since we are not trying to compress, I made the buffer null
Lets discuss on this, If compression can improve the performance, I can work on follow-up PR to do that work

)
);

ColumnBasedFrameRowsAndColumns frc = ColumnBasedFrameRowsAndColumnsTest.buildFrame(input);
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.

I was thinking if this creation could be generailzed by adding it to RowsAndColumnsTestBase#MAKERS - or that's not really usefull?

Comment thread processing/src/main/java/org/apache/druid/query/rowsandcols/RowsAndColumns.java Outdated
Comment thread processing/src/main/java/org/apache/druid/query/rowsandcols/RowsAndColumns.java Outdated
.run();
}

@NotYetSupported(Modes.UNSUPPORTED_DATASOURCE)
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.

hmm.. I wonder how did this started to happen?
its not a blocker just interested

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.

Not very sure though, but I expected this was because we used to send empty to window operator query and that has been changed now. Let me check the actual difference and comment back.

@kgyrtkirk kgyrtkirk added this to the 31.0.0 milestone Sep 16, 2024
@kgyrtkirk kgyrtkirk merged commit bb1c3c1 into apache:master Sep 17, 2024
pranavbhole pushed a commit to pranavbhole/druid that referenced this pull request Sep 17, 2024
… group by (apache#16658)

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Sep 18, 2024
… group by (apache#16658)

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.
@sreemanamala sreemanamala mentioned this pull request Sep 18, 2024
10 tasks
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Sep 18, 2024
… group by (apache#16658)

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.

(cherry picked from commit bb1c3c1)
@sreemanamala sreemanamala deleted the window-fix-nontransferable branch September 18, 2024 11:24
sreemanamala added a commit to sreemanamala/druid that referenced this pull request Sep 19, 2024
… group by (apache#16658)

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.

(cherry picked from commit bb1c3c1)
kgyrtkirk pushed a commit that referenced this pull request Sep 20, 2024
… group by (#16658) (#17111)

Register a Ser-De for RowsAndColumns so that the window operator query running on leaf operators would be transferred properly on the wire. Would fix the empty response given by window queries without group by on the native engine.

(cherry picked from commit bb1c3c1)
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.

2 participants