Skip to content

feat: Add support for Spark Cbrt math expression#3788

Merged
andygrove merged 5 commits intoapache:mainfrom
rafafrdz:feat/add-cbrt-function
May 5, 2026
Merged

feat: Add support for Spark Cbrt math expression#3788
andygrove merged 5 commits intoapache:mainfrom
rafafrdz:feat/add-cbrt-function

Conversation

@rafafrdz
Copy link
Copy Markdown
Contributor

@rafafrdz rafafrdz commented Mar 25, 2026

Summary

  • Add support for Spark's Cbrt (cube root) expression
  • Delegates to DataFusion's built-in cbrt function via CometScalarFunction
  • No native Rust code needed — DataFusion's function registry handles execution
  • SQL test added covering positive, negative, zero, NaN, Infinity, and NULL inputs

Test plan

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

Related to #2084

-- specific language governing permissions and limitations
-- under the License.

-- ConfigMatrix: parquet.enable.dictionary=false,true
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.

No need to test with dictionary encoding. Dictionaries are unpacked before expressions are evaluated.

Suggested change
-- ConfigMatrix: parquet.enable.dictionary=false,true

Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM pending CI. Thanks @rafafrdz

@andygrove andygrove merged commit 1b4b26f into apache:main May 5, 2026
231 of 235 checks passed
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