Skip to content

feat: Add support for Spark Pi math expression#3789

Open
rafafrdz wants to merge 2 commits intoapache:mainfrom
rafafrdz:feat/add-pi-function
Open

feat: Add support for Spark Pi math expression#3789
rafafrdz wants to merge 2 commits intoapache:mainfrom
rafafrdz:feat/add-pi-function

Conversation

@rafafrdz
Copy link
Copy Markdown
Contributor

@rafafrdz rafafrdz commented Mar 25, 2026

Summary

  • Add support for Spark's Pi constant expression
  • Delegates to DataFusion's built-in pi() function via CometScalarFunction
  • No native Rust code needed — DataFusion's function registry handles execution
  • SQL test added verifying the constant value with tight tolerance (1e-15)

Test plan

  • SQL test added: pi.sql
  • CometSqlFileTestSuite verified — all 2 tests pass (dictionary=false/true)

Related to #2084

Add Pi constant function by delegating to DataFusion's built-in
pi() implementation via CometScalarFunction.
Includes SQL test verifying the constant value.
statement
INSERT INTO test_pi VALUES (1.0)

query tolerance=1e-15
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests with tolerance are not confirming that the queries actually ran in Comet due to a bug that I just discovered. Let's merge #3797 first

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