JeelRajodiya opened a new pull request, #21639:
URL: https://github.com/apache/datafusion/pull/21639

   **Rationale**
   
   The `datafusion-spark` crate is missing the `monthname` function. Spark's 
[`monthname(date)`](https://spark.apache.org/docs/latest/api/sql/index.html#monthname)
 returns the **three-letter abbreviated month name** (Jan, Feb, ..., Dec) from 
a date or timestamp — commonly used in Spark SQL workloads.
   
   **What changes are included in this PR?**
   
   Adds `SparkMonthName` to `datafusion-spark`'s datetime functions. It uses 
`arrow::compute::date_part(DatePart::Month)` to extract the month number and 
maps it to the abbreviated name. The signature accepts **Timestamp types** with 
automatic coercion from Date32/Date64.
   
   **Are these changes tested?**
   
   Yes — 6 unit tests covering scalar dates, array dates with nulls, null 
scalars, timestamp microseconds, all 12 months, and return field nullability.
   
   **Are there any user-facing changes?**
   
   New `monthname` scalar function available when using `datafusion-spark`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to