vranes opened a new pull request, #60787:
URL: https://github.com/apache/spark/pull/60787

   ### What changes were proposed in this pull request?
   
   The whole-stage codegen of `BinByExec` binds the bin width and the origin 
through `ctx.addReferenceObj`. The generated code reads each value one time 
into a `long` field. Before this change, the generated source contained both 
values as literals.
   
   ### Why are the changes needed?
   
   `CodeGenerator` caches compiled classes by source text. With the literals, 
each new `BIN WIDTH` or `ALIGN TO` value compiled a new stage class. Now 
queries that differ only in these values use the same compiled class.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   A new test in `BinBySuite` asserts that two queries with different `BIN 
WIDTH` and `ALIGN TO` values generate the same stage source and return the same 
rows as the non-codegen path.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Isaac
   
   This pull request and its description were written by Isaac.
   


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