adriangb commented on code in PR #24165:
URL: https://github.com/apache/datafusion/pull/24165#discussion_r3737770315


##########
datafusion/proto-models/src/generated/prost.rs:
##########
@@ -2029,6 +2029,15 @@ pub struct HashJoinExecNode {
     /// Optional dynamic filter expression for pushing down to the probe side.
     #[prost(message, optional, tag = "11")]
     pub dynamic_filter: ::core::option::Option<PhysicalExprNode>,
+    /// Optional row limit pushed into the join by the `limit_pushdown` rule.
+    ///
+    /// This is presence-tracked (`optional`) on purpose: messages produced by
+    /// versions predating this field carry no `fetch` at all, and a plain 
proto3
+    /// scalar would decode that absence as `0`, i.e. "fetch 0 rows", silently
+    /// turning old plans into empty results. With `optional`, absent decodes 
to
+    /// `None`, which is the correct reading of an older message.
+    #[prost(uint64, optional, tag = "12")]
+    pub fetch: ::core::option::Option<u64>,

Review Comment:
   Yes, it will. Downstream code building HashJoinExecNode with an exhaustive 
struct literal will need a new field. In practice prost's Message derive 
supplies a Default impl, so the `..Default::default()` form is unaffected; 
that's the idiom used in-tree too: 
https://github.com/apache/datafusion/blob/92f4e8f3eeb7b8426399063b4226a591d0c062b3/datafusion/proto/src/physical_plan/mod.rs#L1371-L1377
   
   This is also the established way these messages evolve — HashJoinExecNode 
has gained a field four times already: projection (#9236), null_equality 
(#16419), null_aware (#19635) and dynamic_filter (#22011). Short of never 
adding fields, there isn't a mechanism that avoids it.



-- 
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]

Reply via email to