Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: zombee0 <[email protected]>
  • Loading branch information
zombee0 committed Jan 7, 2025
1 parent 9212b93 commit d354aeb
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,7 @@ public DecodeInfo visitPhysicalOlapScan(OptExpression optExpression, DecodeInfo
continue;
}

info.outputStringColumns.union(column);
info.inputStringColumns.union(column);
stringRefToDefineExprMap.put(column.getId(), column);
scanStringColumns.add(column.getId());
expressionStringRefCounter.put(column.getId(), 0);
globalDicts.put(column.getId(), dict.get());
scanColumnRefSet.union(column.getId());
markedAsGlobalDictOpt(info, column, dict.get());
}

if (info.outputStringColumns.isEmpty()) {
Expand Down Expand Up @@ -658,13 +652,7 @@ public DecodeInfo visitPhysicalHiveScan(OptExpression optExpression, DecodeInfo
continue;
}

info.outputStringColumns.union(column);
info.inputStringColumns.union(column);
stringRefToDefineExprMap.put(column.getId(), column);
scanStringColumns.add(column.getId());
expressionStringRefCounter.put(column.getId(), 0);
globalDicts.put(column.getId(), dict.get());
scanColumnRefSet.union(column.getId());
markedAsGlobalDictOpt(info, column, dict.get());
}

if (info.outputStringColumns.isEmpty()) {
Expand All @@ -674,6 +662,16 @@ public DecodeInfo visitPhysicalHiveScan(OptExpression optExpression, DecodeInfo
return info;
}

private void markedAsGlobalDictOpt(DecodeInfo info, ColumnRefOperator column, ColumnDict dict) {
info.outputStringColumns.union(column);
info.inputStringColumns.union(column);
stringRefToDefineExprMap.put(column.getId(), column);
scanStringColumns.add(column.getId());
expressionStringRefCounter.put(column.getId(), 0);
globalDicts.put(column.getId(), dict);
scanColumnRefSet.union(column.getId());
}

// complex type may be support prune subfield, doesn't read data
private boolean checkComplexTypeInvalid(PhysicalOlapScanOperator scan, ColumnRefOperator column) {
String colName = scan.getColRefToColumnMetaMap().get(column).getName();
Expand Down

0 comments on commit d354aeb

Please sign in to comment.