Skip to content

[SPARK-59093][PS][FOLLOWUP] Reuse the floating floor division expression - #58715

Closed
Spenserrrr wants to merge 1 commit into
apache:masterfrom
Spenserrrr:floordiv-digest-followup
Closed

[SPARK-59093][PS][FOLLOWUP] Reuse the floating floor division expression#58715
Spenserrrr wants to merge 1 commit into
apache:masterfrom
Spenserrrr:floordiv-digest-followup

Conversation

@Spenserrrr

@Spenserrrr Spenserrrr commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This is a small follow-up to #58397: _floor_divide_func now constructs the floating-point result once and reuses it for the floating and decimal branches. The adjacent F.floor comment now distinguishes ANSI overflow from non-ANSI saturation.

Why are the changes needed?

The same lazy Column expression was constructed twice while building floor division, and the comment described only the ANSI behavior.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Ran test_floordiv and test_rfloordiv; a targeted construction probe confirmed one helper call instead of two with an identical Spark expression.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

@Spenserrrr
Spenserrrr marked this pull request as ready for review September 10, 2026 22:24
@Spenserrrr

Copy link
Copy Markdown
Contributor Author

Hi @zhengruifeng! This is a small cleanup follow-up to #58397. It reuses the floating floor-division expression instead of constructing it twice and corrects the F.floor comment to distinguish ANSI overflow from non-ANSI saturation. Could you take a look when you have time? Thanks!

zhengruifeng pushed a commit that referenced this pull request Sep 11, 2026
### What changes were proposed in this pull request?

This is a small follow-up to #58397: `_floor_divide_func` now constructs the floating-point result once and reuses it for the floating and decimal branches. The adjacent `F.floor` comment now distinguishes ANSI overflow from non-ANSI saturation.

### Why are the changes needed?

The same lazy `Column` expression was constructed twice while building floor division, and the comment described only the ANSI behavior.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Ran `test_floordiv` and `test_rfloordiv`; a targeted construction probe confirmed one helper call instead of two with an identical Spark expression.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

Closes #58715 from Spenserrrr/floordiv-digest-followup.

Authored-by: Spenser Sun <hsun112358@gmail.com>
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
(cherry picked from commit 0edaeb8)
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
@zhengruifeng

Copy link
Copy Markdown
Contributor

Merge Summary:

Posted by merge_spark_pr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants