Skip to content

Add missing interval types#1613

Merged
SpencerTorres merged 1 commit intoClickHouse:mainfrom
marcboeker:add-missing-interval-types
Jul 21, 2025
Merged

Add missing interval types#1613
SpencerTorres merged 1 commit intoClickHouse:mainfrom
marcboeker:add-missing-interval-types

Conversation

@marcboeker
Copy link
Copy Markdown
Contributor

Summary

The following missing interval types have been added:

  • IntervalNanosecond
  • IntervalMicrosecond
  • IntervalMillisecond
  • IntervalQuarter

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 21, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for four missing interval types to the column parsing functionality: nanosecond, microsecond, millisecond, and quarter intervals. This extends the existing interval type support to provide more granular time precision options and quarterly time periods.

  • Adds support for sub-second interval types (nanosecond, microsecond, millisecond)
  • Adds support for quarterly interval type
  • Maintains existing functionality for all previously supported interval types

Comment on lines 43 to +44
switch col.chType = t; col.chType {
case "IntervalSecond", "IntervalMinute", "IntervalHour", "IntervalDay", "IntervalWeek", "IntervalMonth", "IntervalYear":
case "IntervalNanosecond", "IntervalMicrosecond", "IntervalMillisecond", "IntervalSecond", "IntervalMinute", "IntervalHour", "IntervalDay", "IntervalWeek", "IntervalMonth", "IntervalQuarter", "IntervalYear":
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The case statement has become quite long with 11 interval types. Consider using a map or slice to store supported interval types and check membership, which would improve readability and make future additions easier to maintain.

Copilot uses AI. Check for mistakes.
@SpencerTorres SpencerTorres merged commit 3b95451 into ClickHouse:main Jul 21, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants