Skip to content

Commit

Permalink
Fix open error (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Jul 27, 2023
1 parent c59da41 commit 52ca279
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cpp/src/storage/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class Manifest {
FragmentVector vector_fragments_;
FragmentVector delete_fragments_;

int64_t version_;
int64_t version_ = 0;
};
} // namespace milvus_storage
4 changes: 2 additions & 2 deletions cpp/src/storage/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ using FilterSet = std::vector<std::unique_ptr<Filter>>;
struct ReadOptions {
FilterSet filters;
std::vector<std::string> columns; // must have pk and version
int limit = -1;
int64_t version = -1;
// int limit = -1;
int64_t version = INT64_MAX;

static ReadOptions& default_read_options() {
static ReadOptions options;
Expand Down
7 changes: 3 additions & 4 deletions cpp/src/storage/space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ Status Space::Delete(arrow::RecordBatchReader* reader) {

std::unique_ptr<arrow::RecordBatchReader> Space::Read(std::shared_ptr<ReadOptions> option) {
if (manifest_->schema()->options()->has_version_column()) {
option->filters.push_back(std::make_unique<ConstantFilter>(ComparisonType::LESS_EQUAL,
manifest_->schema()->options()->version_column,
option->has_version() ? option->version : INT64_MAX));
option->filters.push_back(std::make_unique<ConstantFilter>(
ComparisonType::LESS_EQUAL, manifest_->schema()->options()->version_column, option->version));
}
// TODO: remove second argument
return RecordReader::MakeRecordReader(manifest_, manifest_->schema(), fs_, delete_fragments_, option);
Expand Down Expand Up @@ -249,7 +248,7 @@ Result<arrow::fs::FileInfoVector> Space::FindAllManifest(std::shared_ptr<arrow::
const std::string& path) {
arrow::fs::FileSelector selector;
selector.allow_not_found = true;
selector.base_dir = path;
selector.base_dir = GetManifestDir(path);

ASSIGN_OR_RETURN_ARROW_NOT_OK(auto files, fs->GetFileInfo(selector));
std::vector<arrow::fs::FileInfo> info_vec;
Expand Down
1 change: 0 additions & 1 deletion cpp/test/space_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ TEST(SpaceTest, SpaceWriteReadTest) {

auto uri = "file:///tmp/";
ASSERT_AND_ASSIGN(auto space, Space::Open(uri, Options{schema, -1}));
LogOut("xx");

arrow::Int64Builder pk_builder;
ASSERT_STATUS_OK(pk_builder.Append(1));
Expand Down

0 comments on commit 52ca279

Please sign in to comment.