[Fix](auto-partition) fix a concurrent bug of extremely long values (#31005)

This commit is contained in:
zclllyybb
2024-02-18 12:33:53 +08:00
committed by yiguolei
parent 753ff10840
commit 68102fd531
8 changed files with 92 additions and 87 deletions

View File

@ -34,7 +34,6 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
public class PartitionExprUtil {
@ -160,8 +159,7 @@ public class PartitionExprUtil {
partitionName += getFormatPartitionValue(filterStr);
if (hasStringType) {
if (partitionName.length() > 50) {
partitionName = partitionName.substring(0, 30) + Math.abs(Objects.hash(partitionName))
+ "_" + System.currentTimeMillis();
throw new AnalysisException("Partition name's length is over limit of 50. abort to create.");
}
}
} else {