Skip to content

fix(databricks-jdbc-driver): map ISODOW to DAYOFWEEK_ISO in extract template#10665

Open
jwils wants to merge 1 commit intocube-js:masterfrom
jwils:fix/databricks-extract-isodow-mapping
Open

fix(databricks-jdbc-driver): map ISODOW to DAYOFWEEK_ISO in extract template#10665
jwils wants to merge 1 commit intocube-js:masterfrom
jwils:fix/databricks-extract-isodow-mapping

Conversation

@jwils
Copy link
Copy Markdown
Contributor

@jwils jwils commented Apr 9, 2026

Summary

  • CubeSQL's Rust SQL parser emits PostgreSQL-standard date part names
    (e.g. isodow) which get passed through to dialect-specific extract templates
  • Spark SQL does not recognize ISODOW in EXTRACT() — the documented
    equivalent is DAYOFWEEK_ISO (returns Monday=1 through Sunday=7)
  • Adds an isodowDAYOFWEEK_ISO mapping in the Databricks extract
    template, following the same pattern BigqueryQuery uses for DOW/DOY

Ref

Test plan

  • Queries using extract(ISODOW FROM ...) via Cube SQL API produce
    correct results against Databricks
  • Existing extract expressions (epoch, dow, doy, etc.) unaffected

…emplate

CubeSQL emits PostgreSQL-standard date parts like `isodow` for
EXTRACT expressions. Spark SQL does not support `ISODOW` — the
documented equivalent is `DAYOFWEEK_ISO` (Monday=1 through Sunday=7).

This follows the same pattern used by BigqueryQuery, which already
maps DOW → DAYOFWEEK and DOY → DAYOFYEAR.

See: https://docs.databricks.com/en/sql/language-manual/functions/extract.html

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jwils jwils requested a review from a team as a code owner April 9, 2026 19:55
@github-actions github-actions bot added javascript Pull requests that update Javascript code data source driver driver:databricks cubejs-jdbc-driver pr:community Contribution from Cube.js community members. labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cubejs-jdbc-driver data source driver driver:databricks javascript Pull requests that update Javascript code pr:community Contribution from Cube.js community members.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant