You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "gabotechs (via GitHub)" <gi...@apache.org> on 2026/09/01 07:55:00 UTC
Re: [PR] Add ComposedNamedPhysicalExtensionCodec [datafusion]
gabotechs commented on code in PR #24826:
URL: https://github.com/apache/datafusion/pull/24826#discussion_r3901965842
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
@@ -2058,6 +2078,146 @@ impl PhysicalExtensionCodec for ComposedPhysicalExtensionCodec {
}
}
+/// A PhysicalExtensionCodec that tries one of multiple inner codecs until one works.
+/// The name of the codec that successfully encoded an [`ExecutionPlan`] is stored in the
+/// encoded payload, and the codec with that exact name will be used for decoding.
+#[derive(Default, Debug)]
+pub struct ComposedNamedPhysicalExtensionCodec {
+ codecs: HashMap<Cow<'static, str>, Arc<dyn PhysicalExtensionCodec>>,
+}
Review Comment:
I don't think abuse is a worry here, as the provided `String` name is not un-sanitized input coming from the outside. Of course a developer can go crazy and provide an unreasonably long string here out of malice, but they can do that as well while serializing their custom plans, so it's not really a new risk.
My guess is that adding ~30 bytes worth of a string should not bee too bad, because this only affects custom nodes provided by users, not each node in the plan, so it should be negligible.
> If you consider sorted keys, you can implement codec priority as well
:thinking: this sounds interesting, but I don't understand it very well. How would this priority mechanism work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org