[fix](sort)the sort expr nullable info is wrong in some case (#12003)
This commit is contained in:
@ -271,6 +271,11 @@ public class SortInfo {
|
||||
*/
|
||||
public ExprSubstitutionMap createMaterializedOrderExprs(
|
||||
TupleDescriptor sortTupleDesc, Analyzer analyzer) {
|
||||
// the sort node exprs may come from the child outer join node
|
||||
// we need change the slots to nullable from all outer join nullable side temporarily
|
||||
// then the sort node expr would have correct nullable info
|
||||
// after create the output tuple we need revert the change by call analyzer.changeSlotsToNotNullable(slots)
|
||||
List<SlotDescriptor> slots = analyzer.changeSlotToNullableOfOuterJoinedTuples();
|
||||
ExprSubstitutionMap substOrderBy = new ExprSubstitutionMap();
|
||||
for (Expr origOrderingExpr : orderingExprs) {
|
||||
SlotDescriptor materializedDesc = analyzer.addSlotDescriptor(sortTupleDesc);
|
||||
@ -280,6 +285,7 @@ public class SortInfo {
|
||||
substOrderBy.put(origOrderingExpr, materializedRef);
|
||||
materializedOrderingExprs.add(origOrderingExpr);
|
||||
}
|
||||
analyzer.changeSlotsToNotNullable(slots);
|
||||
return substOrderBy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user