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

refactor: rewrite mega type to an enum containing both cases #11539

Merged

Conversation

LorrensP-2158466
Copy link
Contributor

Which issue does this PR close?

Closes #11443 .

Rationale for this change

The return type was getting complex

What changes are included in this PR?

Introduces a new type called SerializedRecordBatchResult, it has the same structure as the issue proposed, I tried others but this one i liked the most.

Are these changes tested?

No, I don't think i can test a type signature change

Are there any user-facing changes?

No, I don't think is changes the public API

@github-actions github-actions bot added the core Core DataFusion crate label Jul 18, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This looks like a great improvement to me

Thank you @LorrensP-2158466

cc @joroKr21 @comphead

@@ -42,6 +42,37 @@ use tokio::task::JoinSet;
type WriterType = Box<dyn AsyncWrite + Send + Unpin>;
type SerializerType = Arc<dyn BatchSerializer>;

/// Result of calling [`serialize_rb_stream_to_object_store`]
Copy link
Contributor

Choose a reason for hiding this comment

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

👨‍🍳 👌

@@ -153,14 +184,17 @@ pub(crate) async fn stateless_serialize_and_write_files(
while let Some(result) = join_set.join_next().await {
match result {
Ok(res) => match res {
Ok((writer, cnt)) => {
SerializedRecordBatchResult::Success {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is much easier to understand now

@alamb alamb merged commit d232065 into apache:main Jul 21, 2024
23 checks passed
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Jul 23, 2024
wiedld pushed a commit to influxdata/arrow-datafusion that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add some structure to capture result of write orchestration function
2 participants