Skip to content

Implement native function of quarter #1518

@slfan1989

Description

@slfan1989

Description

This issue tracks the implementation of the native quarter() function.

Currently, there is no built-in way to directly obtain the quarter of a given date in Auron.
To improve date and time handling capabilities, we plan to introduce a new native function quarter().

This PR serves as a follow-up to #565, which implemented native support for year(), month(), and day() functions.
It extends that work by introducing the quarter() function to provide a more complete set of date extraction capabilities.

Proposed Functionality:

  • Function name: quarter(date_expression)
  • Return type: INT (1–4)
  • Behavior:
    Returns the quarter (Q1–Q4) of the given date.
    Example:
SELECT quarter('2025-03-10');  -- Returns 1
SELECT quarter('2025-08-01');  -- Returns 3

Motivation:

This function enhances date-based analytics by allowing users to easily group or filter records by quarter without complex expressions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions