-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add row count test for estimated row counts for SAI plan on single restrictions #1449
Conversation
public class EstimatedRowCountTest extends SAITester | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test tests only the NEQ operator. It doesn't look like a general test for all estimated row counts.
Consider renaming it to NEQRowCountTest or some other name wich mentions this is a NEQ test only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test class includes only one test function now, which tests only inequality. I prepared the test and class in a way, so more tests can be added inside the class instead of adding new classes. I think it's aligned with existing tests. Let me know if I miss anything.
I will add another simple test, so it's less confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more tests and improved the class name. Let me know if it needs to be improved.
SAIUtil.setLatestVersion(version); | ||
|
||
ColumnFamilyStore cfs = prepareTable(type); | ||
double totalRows = 97.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this number come from?
You are loading 100 rows into the table, not 97.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the table total count is 97 when I debug the code. I will check if I can retrieve the total count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This estimated total is used in the plans factory. I changed to obtain it from the query controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkolaczk this number is calculated by dividing the size of a memtable by the row size. Actually it's probabilistic.
test/unit/org/apache/cassandra/index/sai/plan/EstimatedRowCountTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/index/sai/plan/EstimatedRowCountTest.java
Outdated
Show resolved
Hide resolved
63c798f
to
384df2c
Compare
The test is flaky, see this build failure. |
One local failure example:
Another:
|
384df2c
to
0cc54e3
Compare
@pkolaczk I fixed the flakiness of the test by using a table builder and |
Disables flush on the table as it affects the estimations being executed non-deterministically, resulting in race condition.
a3bc703
to
cba63d5
Compare
Quality Gate passedIssues Measures |
❌ Build ds-cassandra-pr-gate/PR-1449 rejected by Butler2 new test failure(s) in 8 builds Found 2 new test failures
Found 19 known test failures |
…strictions (#1449) Closes riptano/cndb#12139 This PR adds a test of row count of a SAI plan in the presence of restrictions. Currently it tests queries with inequality, equality and half-ranges on different SAI column types and with or without histograms.
Closes https://github.com/riptano/cndb/issues/12139
What is the issue
Changing planning can affect estimated row count of a plan. This test was introduced by #1439 to see how introducing anti-join plan node estimates row count.
What does this PR fix and why was it fixed
This PR adds a test of row count of a plan in the presence of restrictions. Currently it tests queries with inequality, equality and half-ranges on different SAI column types and with or without histograms.
Checklist before you submit for review
NoSpamLogger
for log lines that may appear frequently in the logs