Skip to content
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

feat: packed reader and writer new api #172

Merged
merged 8 commits into from
Feb 17, 2025

Conversation

shaoting-huang
Copy link
Collaborator

@shaoting-huang shaoting-huang commented Feb 10, 2025

main feat for the patch:

  • Column groups and file paths are explicitly defined by users. The packed writer will not split column groups by memory. It follows the user-defined column groups to split arrow records and write into the corresponding file path.
  • Change factory arrow filesystem to singleton arrow file system to support Milvus init core.
  • Separate arrow fs config from storage config.
    related: [feat]: packed reader and writer new api #171

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shaoting-huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>
Comment on lines 36 to 37
int NewPackedReader(const char* path,
CPaths paths,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the meanings of those two path arguments?

@@ -24,11 +24,13 @@
#include <memory>

int NewPackedReader(const char* path,
CPaths paths,
struct ArrowSchema* schema,
const int64_t buffer_size,
CPackedReader* c_packed_reader) {
try {
auto truePath = std::string(path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this path only used to initialize fs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved cgo part to milvus

Comment on lines +45 to +50
PackedRecordBatchWriter(std::shared_ptr<arrow::fs::FileSystem> fs,
std::vector<std::string>& paths,
std::shared_ptr<arrow::Schema> schema,
std::shared_ptr<arrow::fs::FileSystem> fs,
const std::string& file_path,
const StorageConfig& storage_config);
StorageConfig& storage_config,
std::vector<std::vector<int>>& column_groups,
size_t buffer_size = DEFAULT_WRITE_BUFFER_SIZE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother passing fs instance if we can create it from storage_config?

Or, if fs contains all needed information from storage_config, we can pass fs only.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move arrow fs related config out from storage_config to arrow_fs_config

Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>

void Release() {}

ArrowFileSystemPtr GetArrowFileSystem() { return afs_; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother creating a ArrowFileSystemSingleton instance, if we have the afs_ instance already?

Additionally, we should assert the afs_ exist in such method.

Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>
@tedxu
Copy link
Collaborator

tedxu commented Feb 17, 2025

/lgtm

@sre-ci-robot sre-ci-robot merged commit 58df0bb into milvus-io:main Feb 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants