Skip to content

[CALCITE-2359] Fix inconsistent results casting single-field intervals to integers#730

Closed
jduo wants to merge 3 commits intoapache:masterfrom
jduo:CALCITE-2359
Closed

[CALCITE-2359] Fix inconsistent results casting single-field intervals to integers#730
jduo wants to merge 3 commits intoapache:masterfrom
jduo:CALCITE-2359

Conversation

@jduo
Copy link
Member

@jduo jduo commented Jun 12, 2018

Ensure casting single-field intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:

  • Casting a standalone day interval literal returned results in terms of unit.
  • Casting a standalone year interval literal returned results in terms of months.
  • Casting a day interval expression returned results in terms of milliseconds.
  • Casting a year interval expression returned results in terms of months.

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.
@jduo jduo changed the title [CALCITE-2359] Fix inconsistent results casting intervals to integers [CALCITE-2359] Fix inconsistent results casting single-field intervals to integers Jun 12, 2018
jduo added 2 commits June 15, 2018 02:31
… (James Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.
@michaelmior
Copy link
Member

Thanks for the contribution! It would make things easier to review if you could squash those three commits down to one.

@jduo jduo closed this Jun 27, 2018
@jduo jduo deleted the CALCITE-2359 branch June 27, 2018 23:32
@jduo jduo restored the CALCITE-2359 branch June 27, 2018 23:33
@jduo jduo reopened this Jun 27, 2018
julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Jun 29, 2018
…mes Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.

Close apache#730
julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Jun 29, 2018
…mes Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.

Close apache#730
@asfgit asfgit closed this in 184bb18 Jun 29, 2018
wangxlong pushed a commit to wangxlong/calcite that referenced this pull request Feb 13, 2020
…mes Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.

Close apache#730
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Aug 28, 2025
…mes Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.

Close apache#730

Change-Id: Icf875d2277cc8efd323f2ac404bc7888d397080d
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Mar 16, 2026
…mes Duong)

Ensure casting intervals to integers always returns the result in terms
of the trailing unit.

Previously we had the following behavior:
- Casting a standalone day interval literal returned results in terms of the trailing unit.
- Casting a standalone year interval literal returned results in terms of months.
- Casting a day interval expression returned results in terms of milliseconds.
- Casting a year interval expression returned results in terms of months.

Close apache#730

Change-Id: Icf875d2277cc8efd323f2ac404bc7888d397080d
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.

2 participants