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

Remove unnecessary Block getLogicalSizeInBytes #23688

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

dain
Copy link
Member

@dain dain commented Oct 6, 2024

Description

This was only used in a few places, and was not implement correctly in several container block implementations.

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Remove `Block.getLogicalSizeInBytes`. ({issue}`23688`)

dain added 2 commits October 5, 2024 21:08
This was only used in a few places, and was not implement correctly in
several container block implementations.
@dain dain requested review from electrum and wendigo October 6, 2024 04:14
@cla-bot cla-bot bot added the cla-signed label Oct 6, 2024
@@ -577,6 +586,38 @@ private synchronized QueryResultRows removePagesFromExchange(ResultQueryInfo que
return resultBuilder.build();
}

private static long estimateJsonSize(Page page)
Copy link
Member Author

Choose a reason for hiding this comment

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

@wendigo I'm not sure if we really need this. Of the 3 usages, this is the only one where I could see it mattering (assuming logical size was actually implemented correctly).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll take a look

Copy link
Contributor

@wendigo wendigo Oct 6, 2024

Choose a reason for hiding this comment

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

As far as I understand this code, we are trying to produce a JSON from a Page that has a logical size of the targetResultBytes. If the block is using dictionary encoding this could produce much bigger JSON which can affect the existing protocol. In the spooled protocol we don't care much about these cases and use the page size instead. The change you've made here is good enough as this is suppose to be an estimate anyway.

@dain dain merged commit 934caa4 into trinodb:master Oct 8, 2024
92 of 93 checks passed
@dain dain deleted the remove-logical-size-in-bytes branch October 8, 2024 03:24
@github-actions github-actions bot added this to the 461 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants