bit2swaz opened a new pull request, #27589:
URL: https://github.com/apache/datafusion/pull/27589

   ## Which issue does this PR close?
   
   - Closes #27543.
   
   ## Rationale for this change
   
   If a plan that already ran is encoded with `datafusion-proto`, its dynamic 
filters keep their final runtime state, for example the last TopK threshold. 
The decoded plan then applies that state from the start and can return too few 
rows with no error.
   
   This is intended, so a half-executed plan can resume elsewhere. But nothing 
tells users to call `reset_plan_states` first. See the discussion in 
[#27543](https://github.com/apache/datafusion/issues/27543).
   
   ## What changes are included in this PR?
   
   - A short `# Serializing an executed plan` section in the 
`reset_plan_states` docs.
   - A proto test that pins this behavior.
   
   ## What is the testing strategy for this PR?
   
   `test_dynamic_filter_roundtrip_after_execution_and_reset` in 
`datafusion/proto/tests/cases/plans/dynamic_filters.rs` runs TopK ASC, TopK 
DESC and a hash join whose filter is pushed into the Parquet scan. It executes 
each plan, calls `reset_plan_states`, encodes, decodes, runs it again and 
checks the row count. Without the `reset_plan_states` call, the TopK case 
returns 0 rows instead of 1.
   
   ## Are there any user-facing changes?
   
   Docs only. No API changes.
   
   ---
   
   I used Claude Code to help write the test and the docs. I reviewed and ran 
all of it myself.
   


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