Skip to content

Commit

Permalink
fix allocate symbol by Expression
Browse files Browse the repository at this point in the history
Signed-off-by: Weihao Li <[email protected]>
  • Loading branch information
Wei-hao-Li committed Jun 25, 2024
1 parent bf2f741 commit 07b3c83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ public <T extends Expression> PlanBuilder appendProjections(
// or that are duplicated in the list of exp
if (!mappings.containsKey(scopeAwareKey(expression, analysis, translations.getScope()))
&& !alreadyHasTranslation.test(translations, expression)) {
Symbol symbol =
symbolAllocator.newSymbol(expression.toString(), analysis.getType(expression));
Symbol symbol = symbolAllocator.newSymbol(expression, analysis.getType(expression));
queryContext.getTypeProvider().putTableModelType(symbol, analysis.getType(expression));
projections.put(symbol, rewriter.apply(translations, expression));
mappings.put(scopeAwareKey(expression, analysis, translations.getScope()), symbol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private static List<Symbol> computeOutputs(
FieldReference reference = (FieldReference) expression;
symbol = builder.getFieldSymbols()[reference.getFieldIndex()];
}
outputSymbols.add(symbol != null ? symbol : new Symbol(expression.toString()));
outputSymbols.add(symbol != null ? symbol : builder.translate(expression));
}
return outputSymbols.build();
}
Expand Down

0 comments on commit 07b3c83

Please sign in to comment.