cube icon indicating copy to clipboard operation
cube copied to clipboard

fix(cubesql): Support to_timestamp(epoch) pg function, fix #8901

Open droidraja opened this issue 1 year ago • 7 comments

Check List

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

Issue Reference this PR resolves #8901

droidraja avatar Nov 03 '24 07:11 droidraja

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

vercel[bot] avatar Nov 03 '24 07:11 vercel[bot]

@droidraja Thanks for contributing! Could you please provide at least one test for it? Thanks!

paveltiunov avatar Nov 03 '24 19:11 paveltiunov

@droidraja Thanks for contributing! Could you please provide at least one test for it? Thanks!

@paveltiunov, ~~This does not work for complex queries like to_timetamp(cast(epoch_varchar as numeric(10))) which is being issued by quicksight, will add a UDF to handle the same and push the changes with tests in some time~~

droidraja avatar Nov 03 '24 19:11 droidraja

@paveltiunov have added the udf and testcases, please go ahead with the review.

droidraja avatar Nov 03 '24 20:11 droidraja

@droidraja Could you also please update the docs here? https://cube.dev/docs/reference/sql-api#data-type-formatting-functions

igorlukanin avatar Nov 18 '24 12:11 igorlukanin

@igorlukanin This PR and the existing functionality supports evaluation of constant expression to cube time dimension filter and to_timestamp can't be applied to any columns. So it doesn't support both projection and post processing that is mentioned in the docs.

@paveltiunov please correct my understanding if there are any holes.

droidraja avatar Nov 19 '24 08:11 droidraja

@MazterQyou WDYT?

KSDaemon avatar Oct 09 '25 10:10 KSDaemon