ClickHouse: Add function year() that returns current year

Use case

Similar logic as in now() and today() it returns current year.

Describe the solution you’d like

year() = year(now()) = year(today())

Currently year() fails: Code: 42. DB::Exception: Number of arguments for function toYear doesn't match: passed 0, should be 1 or 2: While processing toYear(). (NUMBER_OF_ARGUMENTS_DOESNT_MATCH) (version 22.13.1.294 (official build))

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

@ucasfl #48321 Here is my pr, please check it.

Hey @ucasfl I’m working on it…I will raise pr asap.

is it still open?

It’s still open.

Hi @qoega Can I work on this issue??