-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix update bugs #2098
Fix update bugs #2098
Conversation
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 doesn't seem to work properly for me. I checked out this branch and modified the InsertManyNodesTest to also check the inserted values, and it's still failing:
diff --git a/test/storage/node_insertion_deletion_test.cpp b/test/storage/node_insertion_deletion_test.cpp
index e5cb932b9..7d9fa4e97 100644
--- a/test/storage/node_insertion_deletion_test.cpp
+++ b/test/storage/node_insertion_deletion_test.cpp
@@ -87,12 +87,18 @@ TEST_F(NodeInsertionDeletionTests, InsertManyNodesTest) {
auto preparedStatement = conn->prepare("CREATE (:person {ID:$id});");
for (int64_t i = 0; i < BufferPoolConstants::PAGE_4KB_SIZE; i++) {
auto result =
- conn->execute(preparedStatement.get(), std::make_pair(std::string("id"), 10001 + i));
+ conn->execute(preparedStatement.get(), std::make_pair(std::string("id"), 10000 + i));
ASSERT_TRUE(result->isSuccess()) << result->toString();
}
- auto result = conn->query("MATCH (a:person) WHERE a.ID >= 10001 RETURN COUNT(*);");
+ auto result = conn->query("MATCH (a:person) WHERE a.ID >= 10000 RETURN COUNT(*);");
ASSERT_TRUE(result->hasNext());
auto tuple = result->getNext();
ASSERT_EQ(tuple->getValue(0)->getValue<int64_t>(), BufferPoolConstants::PAGE_4KB_SIZE);
ASSERT_FALSE(result->hasNext());
+ result = conn->query("MATCH (a:person) RETURN a.ID;");
+ int64_t i = 0;
+ while(result->hasNext()) {
+ auto tuple = result->getNext();
+ EXPECT_EQ(i++, tuple->getValue(0)->getValue<int64_t>());
+ }
}
src/storage/store/node_column.cpp
Outdated
if (numValuesPerPage == UINT64_MAX) { | ||
// This is a special case that bit_width is 0. | ||
numValuesPerPage = 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.
Looking forwards to implementing constant compression, I'm not sure this is the best way to handle this, as for constant compression we would have the same maximum values per page, but the values read would be non-zero, so we would actually need to scan them.
Then again, if the constant value is stored in the metadata, rather than in the page, then we would need a special way of scanning it anyway, but the simple implementation I would think (which would also work for variable sized values) would be to store it in the page once and copy it numValues times to the output.
Is your ground truth correct here? Why compare to |
The datasets starts with 0-9999 from a csv. I guess it could only query the ones which are added, but a lot of the time the erroneous values end up with smaller IDs, so it would skip the values and maybe the output would be less helpful. |
Yeah, because the scan runs in parallel, so the output needs to be ordered to be easily checked. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2098 +/- ##
==========================================
- Coverage 89.55% 89.53% -0.03%
==========================================
Files 981 981
Lines 35901 35906 +5
==========================================
- Hits 32151 32148 -3
- Misses 3750 3758 +8
☔ View full report in Codecov by Sentry. |
No description provided.