morningman commented on a change in pull request #3679:
URL: https://github.com/apache/incubator-doris/pull/3679#discussion_r429950455
##########
File path:
fe/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java
##########
@@ -210,7 +215,8 @@ public void createOrUpdateRuntimeInfo(String tableName,
String key, String value
reservePartitionKeyRange = Range.closedOpen(lowerBound,
upperBound);
} catch (AnalysisException e) {
// keys.size is always equal to column.size, cannot reach this
exception
- LOG.warn("Keys size is not equal to column size. Error={}",
e.getMessage());
+ LOG.warn("Keys size is not equal to column size. Error={}, db: {},
table: {}", e.getMessage(),
+ db.getFullName(), olapTable.getName());
Review comment:
I just make a check that if `start offset == Integer.MIN_VALUE`, it will
not drop any partition.
And for adding partition, I just leave it to user to make sure the value is
reasonable.
##########
File path:
fe/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
##########
@@ -114,6 +118,34 @@ private static void checkEnable(String enable) throws
DdlException {
}
}
+ private static void checkStartDayOfMonth(String val) throws DdlException {
+ if (Strings.isNullOrEmpty(val)) {
+ throw new DdlException("Invalid properties: " +
DynamicPartitionProperty.START_DAY_OF_MONTH);
+ }
+ try {
+ int dayOfMonth = Integer.parseInt(val);
+ if (dayOfMonth < 1 || dayOfMonth > 28) {
Review comment:
I have already stated the reason in the document, I will add some
comments here.
##########
File path: fe/src/main/java/org/apache/doris/common/util/TimeUtils.java
##########
@@ -268,4 +269,11 @@ public static String
checkTimeZoneValidAndStandardize(String value) throws DdlEx
}
throw new DdlException("Parse time zone " + value + " error");
}
+
+ // return the number of days of give year.month
+ public static int getNumberDaysOfMonth(int year, int month) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(year, month + 1, 0);
Review comment:
This function is useless, i will remove it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]