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

makeDateTime64 only accepts constant fraction #58590

Closed
ekpdt opened this issue Jan 8, 2024 · 0 comments · Fixed by #58597
Closed

makeDateTime64 only accepts constant fraction #58590

ekpdt opened this issue Jan 8, 2024 · 0 comments · Fixed by #58597
Assignees
Labels
potential bug To be reviewed by developers and confirmed/rejected.

Comments

@ekpdt
Copy link

ekpdt commented Jan 8, 2024

Describe what's wrong

The function makeDateTime64 only accepts constant fractions-of-a-second

https://fiddle.clickhouse.com/8656706e-975f-49bd-b653-17cbb4e4360b

SELECT makeDateTime64(1970, 1, 1, 12, 0, 0, rand(), 9, 'UTC');

Received exception from server (version 23.12.2):
Code: 44. DB::Exception: Received from localhost:9000. DB::Exception: Illegal type of argument #7 'fraction' of function makeDateTime64, expected const Number, got UInt32: While processing makeDateTime64(1970, 1, 1, 12, 0, 0, rand(), 9, 'UTC'). (ILLEGAL_COLUMN)
(query: SELECT makeDateTime64(1970, 1, 1, 12, 0, 0, rand(), 9, 'UTC'))

Does it reproduce on recent release?

Reproduces on >= 23.9
On 23.8, evaluates to the max value

https://fiddle.clickhouse.com/323b5b56-5956-4eef-b718-47d920b4b82e

SELECT makeDateTime64(1970, 1, 1, 12, 0, 0, rand(), 9, 'UTC');

1970-01-01 12:00:00.999999999

Expected behavior

This function should accept non-constant data (e.g. identifier for a column)

@ekpdt ekpdt added the potential bug To be reviewed by developers and confirmed/rejected. label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug To be reviewed by developers and confirmed/rejected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants