milenkovicm commented on code in PR #24826:
URL: https://github.com/apache/datafusion/pull/24826#discussion_r3903665570
##########
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 was talking about something slightly different.
Lets say you have event E which had 3 versions (lets say backward
compatible), lets say that you have two codecs C1 and C2 each of which can
encode E, C1 can encode in version 2, C2 can encode version 3. if you do not
have codec priority, just by naming things, C1 could encode E even when C2 has
latest version, so your encoding process will remove peace of information
unnecessary.
so someone should make decision who to go first, and they should be able
to say which one has precedence
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]