[Bug](materialized-view) fix core dump when create mv have case different with base table (#18206)

fix core dump when create mv have case different with base table
This commit is contained in:
Pxl
2023-03-31 12:32:09 +08:00
committed by GitHub
parent 1b2aaab2f2
commit 307170030c
7 changed files with 90 additions and 7 deletions

View File

@ -85,6 +85,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
/**
@ -384,7 +385,7 @@ public class RollupJobV2 extends AlterJobV2 implements GsonPostProcessable {
DescriptorTable descTable = new DescriptorTable();
TupleDescriptor destTupleDesc = descTable.createTupleDescriptor();
Map<String, SlotDescriptor> descMap = Maps.newHashMap();
Map<String, SlotDescriptor> descMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
List<Column> rollupColumns = new ArrayList<Column>();
Set<String> columnNames = new HashSet<String>();

View File

@ -505,7 +505,7 @@ public class InsertStmt extends DdlStmt {
// Check if all columns mentioned is enough
checkColumnCoverage(mentionedColumns, targetTable.getBaseSchema());
Map<String, Expr> slotToIndex = Maps.newTreeMap();
Map<String, Expr> slotToIndex = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
List<Column> baseColumns = targetTable.getBaseSchema();
int size = Math.min(baseColumns.size(), queryStmt.getResultExprs().size());
for (int i = 0; i < size; i++) {