Skip to content

feat: suport spark compatible floor function#20860

Open
coderfender wants to merge 1 commit intoapache:mainfrom
coderfender:df_spark_floor
Open

feat: suport spark compatible floor function#20860
coderfender wants to merge 1 commit intoapache:mainfrom
coderfender:df_spark_floor

Conversation

@coderfender
Copy link
Contributor

Which issue does this PR close?

Part of #15914

Rationale for this change

Spark compatible semantics for floor function

What changes are included in this PR?

Implements SparkFloor UDF with Spark-compatible return types:

  • Float/Integer inputs -> Int64
  • Decimal128(p, s) -> Decimal128(p-s+1, 0)

Are these changes tested?

Yes . Added unit tests and SLT tests

Are there any user-facing changes?

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) spark labels Mar 11, 2026
@coderfender coderfender changed the title feat: feat: suport spark compatible floor function Mar 11, 2026
@xanderbailey
Copy link
Contributor

xanderbailey commented Mar 11, 2026

Is this a duplicate of #20594? Test suite here looks more comprehensive, maybe @shivbhatia10 might like to take a look?

@coderfender
Copy link
Contributor Author

coderfender commented Mar 11, 2026

@xanderbailey Yeah , I initially though since @shivbhatia10 implemented ceil function , I would go for other math function but turns out we have 4 pending PRs from his side and I started reviewing his implementations to help the effort and take one for the team :)

@coderfender
Copy link
Contributor Author

coderfender commented Mar 11, 2026

@xanderbailey left review as well #20593

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

Labels

spark sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants