-
Notifications
You must be signed in to change notification settings - Fork 5
fix: Fix overflow for vertex/edge insersion #8
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
Open
zhanglei1949
wants to merge
33
commits into
main
Choose a base branch
from
fix-overflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+555
−190
Open
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
a2f627c
fix overflow for vertex/edge insert
zhanglei1949 4b84450
minor
zhanglei1949 bc11284
Update include/neug/utils/growth.h
zhanglei1949 3a96008
fix format
zhanglei1949 8627f3a
Merge branch 'main' into fix-overflow
zhanglei1949 0bf6026
reserve and dump
zhanglei1949 f4e93f4
remove logs
zhanglei1949 b137742
Merge branch 'main' into fix-overflow
zhanglei1949 dae1473
fix format
zhanglei1949 6a1623b
fix test
zhanglei1949 1ad875d
Merge branch 'main' into fix-overflow
zhanglei1949 645584c
Update src/utils/file_utils.cc
zhanglei1949 eb61a06
minor fix
zhanglei1949 f6501a8
fix string column reserve
zhanglei1949 40000f7
Update include/neug/utils/growth.h
zhanglei1949 69f43da
Update src/utils/file_utils.cc
zhanglei1949 9fd1bbc
fix string column stream compact
zhanglei1949 190ca50
diff capacity reserve for open/dump and inserting
zhanglei1949 b56eccc
refine ccache and try to test whether upload codecov could succeed
zhanglei1949 8e04f41
revert comment
zhanglei1949 4f900a6
fix cpp test
zhanglei1949 ebe5e12
fix avg width calculation
zhanglei1949 a9ed556
Merge branch 'fix-overflow' of https://github.com/alibaba/neug into f…
zhanglei1949 f9c31f7
fix: Use -I instead of -isystem for vendored third-party headers on m…
BingqingLyu 9fcde04
fix: fix coverage report upload in workflow (#30)
lnfjpt e43ed4f
feat: Support `VARCHAR(max_length)` in NeuG Type System (#25)
shirly121 9d8aab6
test: add test for inserting string in embedding mode (#31)
zhanglei1949 7bdab8a
format
zhanglei1949 cd63a3c
merge main
zhanglei1949 5d6db2c
remove wrongly added file
zhanglei1949 f85ace2
fix
zhanglei1949 57f713f
remove some comments
zhanglei1949 43f38c4
params must be set for EnsureCapacity
zhanglei1949 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * Copyright 2020 Alibaba Group Holding Limited. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <cstddef> | ||
| #include <cstdint> | ||
|
|
||
| namespace neug { | ||
| inline size_t calculate_new_capacity(size_t current_capacity, | ||
| bool is_vertex_table) { | ||
| if (current_capacity < 4096) { | ||
| return 4096; // Start with a reasonable default capacity. | ||
| } | ||
| static constexpr size_t MAX_CAPACITY = std::numeric_limits<size_t>::max(); | ||
| if (is_vertex_table) { | ||
| // For vertex tables, we grow exponentially: double the current capacity, | ||
| // with a 4K floor. | ||
| return current_capacity <= MAX_CAPACITY / 2 ? current_capacity * 2 | ||
| : MAX_CAPACITY; | ||
| } else { | ||
| // For edge tables, we grow linearly: new capacity = current capacity + | ||
| // (current capacity + 4) / 5. | ||
| return current_capacity <= MAX_CAPACITY - (current_capacity + 4) / 5 | ||
| ? current_capacity + (current_capacity + 4) / 5 | ||
| : MAX_CAPACITY; | ||
| } | ||
| } | ||
| } // namespace neug | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.