Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ public ReplacePartitionClause(PartitionNames partitionNames, PartitionNames temp
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() {
Expand Down Expand Up @@ -131,4 +140,12 @@ public String toSql() {
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;
}
}