Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-46725][SQL] Add DAYNAME function #44758

Closed

Conversation

PetarVasiljevic-DB
Copy link
Contributor

What changes were proposed in this pull request?

Added DAYNAME function that returns three letter abbreviation day name for the specified date to:

  • Scala API
  • Python API
  • R API
  • Spark Connect Scala Client
  • Spark Connect Python Client

Why are the changes needed?

For parity with Snowflake

Does this PR introduce any user-facing change?

Yes, since new function DAYNAME is added

How was this patch tested?

Tested on new unit tests

Was this patch authored or co-authored using generative AI tooling?

No

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

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

@PetarVasiljevic-DB If it is still draft PR, please, add the [WIP] tag to PR's title, and [SQL] too.

@PetarVasiljevic-DB PetarVasiljevic-DB changed the title [SPARK-46725] Add DAYNAME function [SPARK-46725][SQL][WIP] Add DAYNAME function Jan 17, 2024
@MaxGekk MaxGekk changed the title [SPARK-46725][SQL][WIP] Add DAYNAME function [WIP][SPARK-46725][SQL] Add DAYNAME function Jan 17, 2024
python/pyspark/sql/functions/builtin.py Show resolved Hide resolved
python/pyspark/sql/functions/builtin.py Outdated Show resolved Hide resolved
python/pyspark/sql/tests/test_functions.py Outdated Show resolved Hide resolved
Co-authored-by: Maxim Gekk <max.gekk@gmail.com>
@PetarVasiljevic-DB PetarVasiljevic-DB force-pushed the function_daytime branch 2 times, most recently from 7fa5713 to 2c8f801 Compare January 19, 2024 08:34
@PetarVasiljevic-DB PetarVasiljevic-DB marked this pull request as ready for review January 19, 2024 23:24
@PetarVasiljevic-DB PetarVasiljevic-DB changed the title [WIP][SPARK-46725][SQL] Add DAYNAME function [SPARK-46725][SQL] Add DAYNAME function Jan 19, 2024
@MaxGekk
Copy link
Member

MaxGekk commented Jan 21, 2024

+1, LGTM. Merging to master.
Thank you, @PetarVasiljevic-DB and @LuciferYang for review.

@MaxGekk MaxGekk closed this in f7f424d Jan 21, 2024
@MaxGekk
Copy link
Member

MaxGekk commented Jan 21, 2024

@PetarVasiljevic-DB Do you have an account at https://issues.apache.org/jira/browse/SPARK-46725? If so, please, leave a comment in the ticket otherwise send an request to create an account for you.

@@ -1105,6 +1105,20 @@ setMethod("monthname",
column(jc)
})

#' @details
#' \code{dayname}: Extracts the three-letter abbreviated day name from a
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with the function name DAYNAME, but shall we make it clearer in the doc? day-of-week name instead of day name. This is also what snowflake does: https://docs.snowflake.com/en/sql-reference/functions/dayname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants