Skip to content

Add a comment about ColumnStatistics' unknown estimates semantics#254

Merged
martint merged 1 commit intotrinodb:masterfrom
rzeyde-varada:add-estimate-comment
Feb 20, 2019
Merged

Add a comment about ColumnStatistics' unknown estimates semantics#254
martint merged 1 commit intotrinodb:masterfrom
rzeyde-varada:add-estimate-comment

Conversation

@rzeyde-varada
Copy link
Contributor

Extracted from prestodb/presto#12177.

Copy link
Member

Choose a reason for hiding this comment

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

SymbolStatsEstimate is not part of SPI, but rather part of engine, so connectors shouldn't assume any specific behavior.

The method that determines if SymbolStatsEstimate is unknown is io.prestosql.cost.SymbolStatsEstimate#isUnknown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your comment, but in this PR, I was trying to explain the engine's expectations from the connector statistics' estimation API, following prestodb/presto#12177 (comment).
Is it possible to change this comment to explain it better (e.g. what happens when some of the statistics are not available)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OTOH, we can add a link to the documentation (being added by #127) and explain it there. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Hm.. Maybe we could have a section there that describes how connectors should behave? WDYT: @martint @findepi ?

Copy link
Member

Choose a reason for hiding this comment

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

It’s important for that kind of information to be in the API and accessible from the IDE. People don’t read manuals. Also, any API documentation that is not part of the code is even more likely to get stale as we continue to change the code.

Let’s keep it here but remove the reference to the non-spi class and phrase it in terms of how the engine may not be able to derive stats if any of the provided stats is unknown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - pushed an updated commit 23cc24b523ba7d5b8f1284042fee980bc09fede7.

@martint martint merged commit 1f1d4ad into trinodb:master Feb 20, 2019
@rzeyde-varada rzeyde-varada deleted the add-estimate-comment branch February 21, 2019 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants