[opt](mtmv) partition rollup support week and quarter (#39286) (#39477)

pick from master #39286​
This commit is contained in:
zhangdong
2024-08-16 20:01:06 +08:00
committed by GitHub
parent c84cb5cf3d
commit ae8073f155
3 changed files with 113 additions and 1 deletions

View File

@ -47,7 +47,7 @@ import java.util.Optional;
import java.util.Set;
public class MTMVPartitionExprDateTrunc implements MTMVPartitionExprService {
private static Set<String> timeUnits = ImmutableSet.of("year", "month", "day", "hour");
private static Set<String> timeUnits = ImmutableSet.of("year", "quarter", "week", "month", "day", "hour");
private String timeUnit;
public MTMVPartitionExprDateTrunc(FunctionCallExpr functionCallExpr) throws AnalysisException {
@ -198,9 +198,15 @@ public class MTMVPartitionExprDateTrunc implements MTMVPartitionExprService {
case "year":
result = value.plusYears(1L);
break;
case "quarter":
result = value.plusMonths(3L);
break;
case "month":
result = value.plusMonths(1L);
break;
case "week":
result = value.plusWeeks(1L);
break;
case "day":
result = value.plusDays(1L);
break;