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

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

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

mcheshkov
Copy link
Member

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

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

Copy link

codecov bot commented Nov 19, 2024

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 ⚠️
Additional details and impacted files
@@            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 Coverage Δ
cubesql 82.69% <96.42%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@mcheshkov mcheshkov marked this pull request as ready for review November 19, 2024 20:56
@mcheshkov mcheshkov requested a review from a team as a code owner November 19, 2024 20:56
Copy link

vercel bot commented Nov 20, 2024

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) Visit Preview Nov 20, 2024 1:01am
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 1:01am

@mcheshkov mcheshkov merged commit 85eaa29 into master Nov 20, 2024
74 checks passed
@mcheshkov mcheshkov deleted the fix-now-in-pushdown branch November 20, 2024 01:34
ptiurin pushed a commit to firebolt-db/cube that referenced this pull request Nov 27, 2024
…tion (cube-js#8971)

cubesql can introduce `ScalarValue::TimestampNanosecond(..., Some("UTC"))` during constant folding, and `generate_sql_for_expr` trips on unsupported timezones.
This 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
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.

2 participants