Skip to content

fix(bigquery): generate EXTRACT(DAYOFWEEK FROM ...) for DayOfWeek [CLAUDE] - #8778

Open
JoeyTan21 wants to merge 1 commit into
tobymao:mainfrom
JoeyTan21:fix/bigquery-dayofweek
Open

JoeyTan21 wants to merge 1 commit into
tobymao:mainfrom
JoeyTan21:fix/bigquery-dayofweek

Conversation

@JoeyTan21

Copy link
Copy Markdown

Fixes #8767

BigQuery has no DAY_OF_WEEK function, so DAYOFWEEK read from MySQL or Spark was transpiled to invalid BigQuery SQL. All three dialects number days Sunday=1 to Saturday=7, so this maps DayOfWeek to EXTRACT(DAYOFWEEK FROM x), the same way DayOfYear and DayOfMonth are already handled. Added a BigQuery case to the existing MySQL DAYOFWEEK test.

Disclosure: found, reproduced and the draft fix tested locally with the help of an AI coding agent (Claude Code); reviewed before filing.

🤖 Generated with Claude Code

BigQuery has no DAY_OF_WEEK function, so MySQL/Spark DAYOFWEEK(x) used to
transpile to invalid BigQuery SQL. Both use Sunday=1..Saturday=7, which
matches BigQuery's EXTRACT(DAYOFWEEK FROM x).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

BigQuery: DAYOFWEEK from MySQL/Spark is generated as DAY_OF_WEEK, which BigQuery does not have

1 participant