-
Notifications
You must be signed in to change notification settings - Fork 91
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
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.
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; |
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.
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; |
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.
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 { |
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.
nit: please place 'static
at the end of this line.
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.
Let's go!
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.
Looks good! Thanks for working on this @ZENOTME and @liurenjie1024 @Xuanwo for the reviews 👍
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.