cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
17.96k stars 1.78k forks source link

fix(cubesql): Support explicit UTC as timezone in pushdown SQL generation #8971

Closed mcheshkov closed 2 days ago

mcheshkov commented 2 days ago

Check List

Issue Reference this PR resolves

8967

Description of Changes Made (if issue reference is not provided)

cubesql can introduce ScalarValue::TimestampNanosecond(..., Some("UTC")) during constant folding, and generate_sql_for_expr trips on unsupported timezones. This PR just allows None as well as Some("UTC") as timezones. Because DataFusion will always generate UTC, it should be fine for now. See https://github.com/cube-js/arrow-datafusion/blob/dcf3e4aa26fd112043ef26fa4a78db5dbd443c86/datafusion/physical-expr/src/datetime_expressions.rs#L357-L367

codecov[bot] commented 2 days ago

Codecov Report

Attention: Patch coverage is 96.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 82.69%. Comparing base (b75a37a) to head (0fb5a56). Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...t/cubesql/cubesql/src/compile/engine/df/wrapper.rs 25.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8971 +/- ## ========================================== + Coverage 82.66% 82.69% +0.02% ========================================== Files 221 221 Lines 78303 78467 +164 ========================================== + Hits 64727 64885 +158 - Misses 13576 13582 +6 ``` | [Flag](https://app.codecov.io/gh/cube-js/cube/pull/8971/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cube-js) | Coverage Δ | | |---|---|---| | [cubesql](https://app.codecov.io/gh/cube-js/cube/pull/8971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cube-js) | `82.69% <96.42%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cube-js#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

vercel[bot] commented 2 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **examples-angular-dashboard** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-angular-dashboard/8hd49RqWW8ZEfrA6GTAePWUQmPct)) | [Visit Preview](https://examples-angular-dashboard-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-d3** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-d3/FLgZiTT6TYvtWJ6ThpciwtKtigzo)) | [Visit Preview](https://examples-react-d3-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-dashboard** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-dashboard/4bjybAFHV38L8iBGVoVfPWB3pfUC)) | [Visit Preview](https://examples-react-dashboard-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-data-table** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-data-table/2qAYKn2WWGxhZwh2NKUYLcqoCT8v)) | [Visit Preview](https://examples-react-data-table-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-highcharts** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-highcharts/5zf1eSpC8tmo1gG5aLxF4e13e5bB)) | [Visit Preview](https://examples-react-highcharts-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-material-ui** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-material-ui/GPsxwn4xTqgPBbeHzx7bXSthXv1o)) | [Visit Preview](https://examples-react-material-ui-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-react-pivot-table** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-react-pivot-table/GQq1HQaWqwgqfF8dEGWmN6up247w)) | [Visit Preview](https://examples-react-pivot-table-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am | | **examples-vue-query-builder** | ⬜️ Ignored ([Inspect](https://vercel.com/cube-dev/examples-vue-query-builder/P2BNfLsFa8nA13EiWVF3vN6xcF1Q)) | [Visit Preview](https://examples-vue-query-builder-git-fix-now-in-pushdown-cube-dev.vercel.app) | | Nov 20, 2024 1:01am |