Skip to content

Conversation

@gabotechs
Copy link
Collaborator

@gabotechs gabotechs commented Sep 26, 2025

Here are some improvement points I've discovered while playing with the public API:

  • Users might want to provide more than 1 custom codec. Instead of forcing them to wrap their code with a combined codec, we can offer them the possibility to provide more than 1 natively, greatly improving UX.
  • While providing user codecs, the current API does not allow to provide an Arc<dyn PhysicalExtensionCodec>, it only allows to provide non-dynamic codecs. This adds a new with_distributed_user_codec_arc and set_distributed_user_codec_arc variants for providing Arc-wrapped dynamic user codecs
  • Expose some structs that were not public before: DistributedTaskContext and NetworkCoalesceExec. These structures where meant to be part of the public API, but they were not exposed.

@gabotechs gabotechs force-pushed the gabrielmusat/address-public-api-weakpoints branch from 5fa6c7b to 7925912 Compare September 26, 2025 11:05
@gabotechs gabotechs force-pushed the gabrielmusat/address-public-api-weakpoints branch from 7925912 to b2a5d0e Compare September 26, 2025 12:01
// TODO: It's not yet on DF 49, once upgrading to DF 50 we can remove this

// Idea taken from
// https://github.com/apache/datafusion/blob/0eebc0c7c0ffcd1514f5c6d0f8e2b6d0c69a07f5/datafusion-examples/examples/composed_extension_codec.rs#L236-L291
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code was previously taken from an example upstream. However, in version 50, there's a better version of this same code living in the datafusion-proto package, so I took it.

Comment on lines +27 to +29
let mut codecs: Vec<Arc<dyn PhysicalExtensionCodec>> = vec![Arc::new(DistributedCodec {})];
codecs.extend(get_distributed_user_codecs(cfg));
ComposedPhysicalExtensionCodec::new(codecs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now users can provide more than 1 codec

Copy link
Collaborator

@NGA-TRAN NGA-TRAN left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

@gabotechs gabotechs merged commit bfbdf51 into main Sep 29, 2025
4 checks passed
@gabotechs gabotechs deleted the gabrielmusat/address-public-api-weakpoints branch September 29, 2025 14:59
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.

3 participants