-
Notifications
You must be signed in to change notification settings - Fork 344
feat(datafusion): Add TaskWriter for DataFusion #1769
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
Conversation
e875e8e to
f4b72ef
Compare
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.
I think we are on the right track. I left some comments, and we need to split them into smaller prs.
| Fanout(FanoutWriter<B>), | ||
| /// Writer for partitioned tables with sorted data (maintains single active writer) | ||
| Clustered(ClusteredWriter<B>), |
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.
We could simplify this as
Partitioned {
splitter: RecordBatchSplitter,
partitioned_writer: Arc<dyn PartitionedWriter>
}…atchPartitionSplitter (#1781) ## Which issue does this PR close? - Closes #1786 - Covered some of changes from the previous draft: #1769 ## What changes are included in this PR? - Move PartitionValueCalculator to core/arrow so it can be reused by RecordBatchPartitionSplitter - Allow skipping partition value calculation in partition splitter for projected batches - Return <PartitionKey, RecordBatch> rather than <Struct, RecordBatch> pairs in RecordBatchPartitionSplitter::split ## Are these changes tested? Added uts
c5061e2 to
d3d3127
Compare
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.
Thanks @CTTY for this pr, generally LGTM!
|
|
||
| Self { | ||
| writer, | ||
| partition_splitter: None, |
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.
Why not init it here?
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.
This is because partition_splitter requires the schema of record batches, which may contain projected column and differ from the Iceberg schema. it would be safer to just use the schema of record batches directly to initialize partition_splitter
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.
I'm not convinced, in fact, this schema could be inferred from datafusion's ExecutionPlan
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.
Anyway, this is a small code style problem, we can fix it later.
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.
Thanks @CTTY for this pr!
|
|
||
| Self { | ||
| writer, | ||
| partition_splitter: None, |
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.
I'm not convinced, in fact, this schema could be inferred from datafusion's ExecutionPlan
Which issue does this PR close?
What changes are included in this PR?
RecordBatchPartitionSplitterand projected partition valuesAre these changes tested?
Added unit tests