Skip to content

Commit f72dc89

Browse files
committed
Fix expected values in SingleRestrictionEstimatedRowCountTest
Fixes riptano/cndb#12243 main-5.0 uses different default for memetable SAI structure than 5.0. This commits adjusts the expected row count values. Also removes assert on the total row count, since it varies in this branch for different column types.
1 parent 561c122 commit f72dc89

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

test/unit/org/apache/cassandra/index/sai/plan/SingleRestrictionEstimatedRowCountTest.java

+19-19
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,30 @@ public void testMemtablesSAI()
7575
createTables();
7676

7777
RowCountTest test = new RowCountTest(Operator.NEQ, 25);
78-
test.doTest(Version.DB, INT, 97.0);
79-
test.doTest(Version.EB, INT, 97.0);
78+
test.doTest(Version.DB, INT, 83.1);
79+
test.doTest(Version.EB, INT, 82.4);
8080
// Truncated numeric types planned differently
81-
test.doTest(Version.DB, DECIMAL, 97.0);
82-
test.doTest(Version.EB, DECIMAL, 97.0);
83-
test.doTest(Version.EB, VARINT, 97.0);
81+
test.doTest(Version.DB, DECIMAL, 117);
82+
test.doTest(Version.EB, DECIMAL, 117);
83+
test.doTest(Version.EB, VARINT, 119);
8484

8585
test = new RowCountTest(Operator.LT, 50);
86-
test.doTest(Version.DB, INT, 48);
87-
test.doTest(Version.EB, INT, 48);
88-
test.doTest(Version.DB, DECIMAL, 48);
89-
test.doTest(Version.EB, DECIMAL, 48);
86+
test.doTest(Version.DB, INT, 50);
87+
test.doTest(Version.EB, INT, 50);
88+
test.doTest(Version.DB, DECIMAL, 51);
89+
test.doTest(Version.EB, DECIMAL, 51);
9090

9191
test = new RowCountTest(Operator.LT, 150);
92-
test.doTest(Version.DB, INT, 97);
93-
test.doTest(Version.EB, INT, 97);
94-
test.doTest(Version.DB, DECIMAL, 97);
95-
test.doTest(Version.EB, DECIMAL, 97);
92+
test.doTest(Version.DB, INT, 100);
93+
test.doTest(Version.EB, INT, 99);
94+
test.doTest(Version.DB, DECIMAL, 100);
95+
test.doTest(Version.EB, DECIMAL, 99);
9696

9797
test = new RowCountTest(Operator.EQ, 31);
98-
test.doTest(Version.DB, INT, 15);
99-
test.doTest(Version.EB, INT, 0);
100-
test.doTest(Version.DB, DECIMAL, 15);
101-
test.doTest(Version.EB, DECIMAL, 0);
98+
test.doTest(Version.DB, INT, 1);
99+
test.doTest(Version.EB, INT, 1);
100+
test.doTest(Version.DB, DECIMAL, 1);
101+
test.doTest(Version.EB, DECIMAL, 1);
102102
}
103103

104104

@@ -126,7 +126,7 @@ void populateTable(ColumnFamilyStore cfs)
126126
for (int i = 0; i < 100; i++)
127127
{
128128
String query = String.format("INSERT INTO %s (pk, age) VALUES (?, " + i + ')',
129-
cfs.keyspace.getName() + '.' + cfs.name);
129+
cfs.keyspace.getName() + '.' + cfs.name);
130130
executeFormattedQuery(query, "key" + i);
131131
}
132132
});
@@ -155,9 +155,9 @@ void doTest(Version version, CQL3Type.Native type, double expectedRows)
155155
rc,
156156
version.onDiskFormat().indexFeatureSet(),
157157
new QueryContext());
158+
158159
long totalRows = controller.planFactory.tableMetrics.rows;
159160
assertEquals(0, cfs.metrics().liveSSTableCount.getValue().intValue());
160-
assertEquals(97, totalRows);
161161

162162
Plan plan = controller.buildPlan();
163163
assert plan instanceof Plan.RowsIteration;

0 commit comments

Comments
 (0)