-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Deduplicate PhysicalExpr on proto ser/de using Arc pointer addresses #18192
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
base: main
Are you sure you want to change the base?
Changes from all commits
a014ab2
3776705
f2aa11b
5a3fa78
7edec6e
07fb426
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ use crate::logical_plan::{ | |
| self, AsLogicalPlan, DefaultLogicalExtensionCodec, LogicalExtensionCodec, | ||
| }; | ||
| use crate::physical_plan::{ | ||
| AsExecutionPlan, DefaultPhysicalExtensionCodec, PhysicalExtensionCodec, | ||
| AsExecutionPlan, DecodeContext, DefaultPhysicalExtensionCodec, PhysicalExtensionCodec, | ||
| }; | ||
| use crate::protobuf; | ||
| use datafusion_common::{plan_datafusion_err, Result}; | ||
|
|
@@ -313,7 +313,8 @@ pub fn physical_plan_from_json( | |
| let back: protobuf::PhysicalPlanNode = serde_json::from_str(json) | ||
| .map_err(|e| plan_datafusion_err!("Error serializing plan: {e}"))?; | ||
| let extension_codec = DefaultPhysicalExtensionCodec {}; | ||
| back.try_into_physical_plan(&ctx, &extension_codec) | ||
| let decode_ctx = DecodeContext::new(ctx); | ||
| back.try_into_physical_plan(&decode_ctx, &extension_codec) | ||
| } | ||
|
|
||
| /// Deserialize a PhysicalPlan from bytes | ||
|
|
@@ -333,5 +334,6 @@ pub fn physical_plan_from_bytes_with_extension_codec( | |
| ) -> Result<Arc<dyn ExecutionPlan>> { | ||
| let protobuf = protobuf::PhysicalPlanNode::decode(bytes) | ||
| .map_err(|e| plan_datafusion_err!("Error decoding expr as protobuf: {e}"))?; | ||
| protobuf.try_into_physical_plan(ctx, extension_codec) | ||
| let decode_ctx = DecodeContext::new(ctx); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should decode_ctx be method parameter rather than created here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comet is added for consistency with other public methods expecting |
||
| protobuf.try_into_physical_plan(&decode_ctx, extension_codec) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
should decode_ctx be method parameter rather than created 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 comet is added for consistency with other public methods expecting DecodeCtx but I'm not sure we should expose &DecodeContext in public methods, explanation in following comment