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

MySQL compatibility: TO_DAYS function #54277

Closed
slvrtrn opened this issue Sep 4, 2023 · 0 comments · Fixed by #54479
Closed

MySQL compatibility: TO_DAYS function #54277

slvrtrn opened this issue Sep 4, 2023 · 0 comments · Fixed by #54479
Assignees
Labels

Comments

@slvrtrn
Copy link
Contributor

slvrtrn commented Sep 4, 2023

This one is a minor one but is still used by Tableau online when converting DateTime columns during the table column types introspection stage.

image

Sample generated query:

SELECT `cell_towers`.`area`                        AS `area`,
       `cell_towers`.`averageSignal`               AS `averageSignal`,
       `cell_towers`.`cell`                        AS `cell`,
       `cell_towers`.`changeable`                  AS `changeable`,
       `cell_towers`.`created`                     AS `created`,
       `cell_towers`.`lat`                         AS `lat`,
       `cell_towers`.`lon`                         AS `lon`,
       `cell_towers`.`mcc`                         AS `mcc`,
       `cell_towers`.`net`                         AS `net`,
       `cell_towers`.`radio`                       AS `radio`,
       `cell_towers`.`range`                       AS `range`,
       `cell_towers`.`samples`                     AS `samples`,
       `cell_towers`.`unit`                        AS `unit`,
       (TO_DAYS(`cell_towers`.`updated`) - 693961) AS `updated`
FROM `cell_towers`
LIMIT 100

which fails, because

Code: 46. DB::Exception: Unknown function TO_DAYS

How to reproduce

  • Which ClickHouse server version to use: latest master
  • Which interface to use, if matters: MySQL
  • Sample data for all these tables: cell_towers sample dataset

Expected behavior

TO_DAYS function works like in MySQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants