Skip to content

Commit 8cbac78

Browse files
committed
chore: it's declared above
1 parent 55a7b73 commit 8cbac78

File tree

1 file changed

+1
-8
lines changed
  • rust/cubesql/cubesql/src/compile/rewrite/rules

1 file changed

+1
-8
lines changed

rust/cubesql/cubesql/src/compile/rewrite/rules/utils.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -790,12 +790,6 @@ pub fn try_merge_range_with_date_part(
790790
Some((new_start_date, new_end_date))
791791
}
792792
"quarter" | "qtr" => {
793-
// Check that the range only covers one year
794-
let start_date_year = start_date.year();
795-
if start_date_year != end_date.year() {
796-
return None;
797-
}
798-
799793
// Quarter value must be valid
800794
if !(1..=4).contains(&value) {
801795
return None;
@@ -804,8 +798,7 @@ pub fn try_merge_range_with_date_part(
804798
let quarter_start_month = (value - 1) * 3 + 1;
805799

806800
// Obtain the new range
807-
let new_start_date =
808-
NaiveDate::from_ymd_opt(start_date_year, quarter_start_month as u32, 1)?;
801+
let new_start_date = NaiveDate::from_ymd_opt(year, quarter_start_month as u32, 1)?;
809802

810803
let new_end_date = new_start_date
811804
.checked_add_months(Months::new(3))

0 commit comments

Comments
 (0)