Skip to content

feat(function): Add Spark dayname function#15957

Closed
yaooqinn wants to merge 5 commits intofacebookincubator:mainfrom
yaooqinn:feature/add-dayname-function
Closed

feat(function): Add Spark dayname function#15957
yaooqinn wants to merge 5 commits intofacebookincubator:mainfrom
yaooqinn:feature/add-dayname-function

Conversation

@yaooqinn
Copy link
Copy Markdown
Contributor

@yaooqinn yaooqinn commented Jan 9, 2026

Implements the dayname() function for Spark SQL compatibility that returns the three-letter abbreviated day name (Sun, Mon, Tue, Wed, Thu, Fri, Sat) from a given date.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 9, 2026

Deploy Preview for meta-velox ready!

Name Link
🔨 Latest commit 60ff08e
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6965b6e12c5ada0008efe871
😎 Deploy Preview https://deploy-preview-15957--meta-velox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 9, 2026
@yaooqinn yaooqinn changed the title Add dayname() function for Spark SQL feat(function): Add Spark dayname function Jan 9, 2026
Comment thread velox/functions/sparksql/tests/DateTimeFunctionsTest.cpp
Comment thread velox/functions/sparksql/tests/DateTimeFunctionsTest.cpp
Comment thread velox/docs/spark_functions.rst Outdated
:spark:func:`dayofmonth` :spark:func:`map_values` :spark:func:`uuid`
:spark:func:`dayofweek` :spark:func:`map_zip_with` :spark:func:`varchar_type_write_side_check`
:spark:func:`dayofyear` :spark:func:`mask` :spark:func:`week_of_year`
:spark:func:`dayname` :spark:func:`map_values` :spark:func:`uuid`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't update this file, weekly job will does the update

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This helps a lot. Thank you @jinchengchenghh

@yaooqinn yaooqinn force-pushed the feature/add-dayname-function branch from 47a379a to 536ba46 Compare January 12, 2026 07:22
Copy link
Copy Markdown
Contributor

@jinchengchenghh jinchengchenghh left a comment

Choose a reason for hiding this comment

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

Thanks!

EXPECT_EQ("Fri", dayName(parseDate("2023-08-25")));
EXPECT_EQ("Sat", dayName(parseDate("2023-08-26")));
EXPECT_EQ(
"Fri", dayName(parseDate("1582-10-15"))); // Gregorian calendar start
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment should end with .

Comment thread velox/functions/sparksql/tests/DateTimeFunctionsTest.cpp Outdated
yaooqinn and others added 5 commits January 13, 2026 11:07
Implements the dayname() function that returns the three-letter
abbreviated day name (Sun, Mon, Tue, Wed, Thu, Fri, Sat) from a
given date, matching Apache Spark's behavior with Locale.US.
Format long test line in DateTimeFunctionsTest.cpp to align with
project formatting guidelines (clang-format).
@zhli1142015 zhli1142015 force-pushed the feature/add-dayname-function branch from 1d786ff to 60ff08e Compare January 13, 2026 03:07
@zhli1142015 zhli1142015 added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Jan 13, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jan 13, 2026

@kevinwilfong has imported this pull request. If you are a Meta employee, you can view this in D90602088.

@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jan 13, 2026

@kevinwilfong merged this pull request in d11f8e4.

@yaooqinn yaooqinn deleted the feature/add-dayname-function branch January 14, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants