Skip to content

Implement native function of radians(68), degrees(69) #1551

@slfan1989

Description

@slfan1989

Summary

Add radians and degrees with Spark-compatible semantics, implemented natively on Arrow/DataFusion with vectorization. Cover common numeric types to improve performance on large columns and close gaps with Spark SQL function compatibility.

Background & Motivation

  • Align with Apache Spark SQL’s function set to reduce migration/compatibility costs.
  • Replace/augment non-vectorized UDF paths with native, vectorized implementations to lower overhead and increase throughput.
  • Lay the groundwork for completing trigonometric and inverse-trigonometric function coverage.

Semantic Definition (Spark-compatible)

  • radians(x): converts degrees x to radians, formula x * π / 180.
  • degrees(x): converts radians x to degrees, formula x * 180 / π.
  • Numeric widening: input may be any numeric type; output is DOUBLE (Float64).
  • Null semantics: NULL input → NULL result.
  • Special values: NaN and +/-Infinity must propagate per IEEE 754 without throwing exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions