[fix](planner) mark join slot should always be nullable (#25433)

This commit is contained in:
starocean999
2023-10-17 19:14:13 +08:00
committed by GitHub
parent b74836050a
commit 9b1cdd3230
2 changed files with 5 additions and 2 deletions

View File

@ -994,7 +994,10 @@ public class Analyzer {
newTblName == null ? "table list" : newTblName.toString());
}
Column col = d.getTable() == null ? new Column(colName, ScalarType.BOOLEAN) : d.getTable().getColumn(colName);
Column col = (d.getTable() == null)
? new Column(colName, ScalarType.BOOLEAN,
globalState.markTuples.get(d.getAlias()) != null)
: d.getTable().getColumn(colName);
if (col == null) {
ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_FIELD_ERROR, colName,
newTblName == null ? d.getTable().getName() : newTblName.toString());

View File

@ -529,7 +529,7 @@ public class StmtRewriter {
String slotName = stmt.getColumnAliasGenerator().getNextAlias();
markSlot.setType(ScalarType.BOOLEAN);
markSlot.setIsMaterialized(true);
markSlot.setIsNullable(false);
markSlot.setIsNullable(true);
markSlot.setColumn(new Column(slotName, ScalarType.BOOLEAN));
SlotRef markRef = new SlotRef(markSlot);
markRef.setTblName(new TableName(null, null, markTuple.getAlias()));