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: init file writer interface #168

Merged
merged 2 commits into from
Jan 25, 2024
Merged

feat: init file writer interface #168

merged 2 commits into from
Jan 25, 2024

Conversation

ZENOTME
Copy link
Contributor

@ZENOTME ZENOTME commented Jan 18, 2024

related issue: #34
It's the part of #135.

The file writer interface is about the writer for data file format, e.g. parquet, orc.

@ZENOTME
Copy link
Contributor Author

ZENOTME commented Jan 18, 2024

Copy link
Collaborator

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

/// The associated file writer type.
type R: FileWriter<O>;
/// Build file writer.
fn build(self) -> impl std::future::Future<Output = Result<Self::R>> + Send;
Copy link
Member

Choose a reason for hiding this comment

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

nit: How about using Future here for short?

/// Write record batch to file.
fn write(&mut self, batch: &RecordBatch) -> impl std::future::Future<Output = Result<()>> + Send;
/// Close file writer.
fn close(self) -> impl std::future::Future<Output = Result<O>> + Send;
Copy link
Member

Choose a reason for hiding this comment

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

the same.

}

/// File writer focus on writing record batch to different physical file format.(Such as parquet. orc)
pub trait FileWriter<O = DefaultOutput>: Send + 'static + CurrentFileStatus {
Copy link
Member

Choose a reason for hiding this comment

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

nit: please place 'static at the end of this line.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Let's go!

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for working on this @ZENOTME and @liurenjie1024 @Xuanwo for the reviews 👍

@Fokko Fokko merged commit a9104dc into apache:main Jan 25, 2024
7 checks passed
@ZENOTME ZENOTME deleted the file_writer branch January 25, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants