This commit is contained in:
@ -61,6 +61,15 @@ public class ReplacePartitionClause extends AlterTableClause {
|
||||
this.tempPartitionNames = tempPartitionNames;
|
||||
this.needTableStable = false;
|
||||
this.properties = properties;
|
||||
|
||||
// ATTN: During ReplacePartitionClause.analyze(), the default value of isStrictRange is true.
|
||||
// However, ReplacePartitionClause instances constructed by internal code do not call analyze(),
|
||||
// so their isStrictRange value is incorrect (e.g., INSERT INTO ... OVERWRITE).
|
||||
//
|
||||
// Considering this, we should handle the relevant properties when constructing.
|
||||
this.isStrictRange = getBoolProperty(properties, PropertyAnalyzer.PROPERTIES_STRICT_RANGE, true);
|
||||
this.useTempPartitionName = getBoolProperty(
|
||||
properties, PropertyAnalyzer.PROPERTIES_USE_TEMP_PARTITION_NAME, false);
|
||||
}
|
||||
|
||||
public List<String> getPartitionNames() {
|
||||
@ -131,4 +140,12 @@ public class ReplacePartitionClause extends AlterTableClause {
|
||||
public String toString() {
|
||||
return toSql();
|
||||
}
|
||||
|
||||
public static boolean getBoolProperty(Map<String, String> properties, String propKey, boolean defaultVal) {
|
||||
if (properties != null && properties.containsKey(propKey)) {
|
||||
String val = properties.get(propKey);
|
||||
return Boolean.parseBoolean(val);
|
||||
}
|
||||
return defaultVal;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user