Skip to content

Commit

Permalink
branch-2.1: [fix](compile) fix fe compile failed by code too large #4…
Browse files Browse the repository at this point in the history
…6408 (#46420)

Cherry-picked from #46408

Co-authored-by: 924060929 <[email protected]>
  • Loading branch information
github-actions[bot] and 924060929 authored Jan 4, 2025
1 parent 3d6ad47 commit a4c328c
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@

/** ExpressionTypeMappingGenerator */
public class ExpressionTypeMappingGenerator {
private static final Set<String> FORBIDDEN_CLASS = Sets.newHashSet(
"org.apache.doris.nereids.trees.expressions.functions.ExpressionTrait",
"org.apache.doris.nereids.trees.expressions.shape.LeafExpression",
"org.apache.doris.nereids.trees.expressions.shape.UnaryExpression",
"org.apache.doris.nereids.trees.expressions.shape.BinaryExpression",
"org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable",
"org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable",
"org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral",
"org.apache.doris.nereids.trees.expressions.typecoercion.ImplicitCastInputTypes",
"org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature",
"org.apache.doris.nereids.trees.expressions.functions.Function",
"org.apache.doris.nereids.trees.expressions.functions.FunctionTrait",
"org.apache.doris.nereids.trees.expressions.functions.ComputeSignature",
"org.apache.doris.nereids.trees.expressions.functions.scalar.ScalarFunction",
"org.apache.doris.nereids.trees.expressions.typecoercion.ExpectsInputTypes",
"org.apache.doris.nereids.trees.expressions.functions.ComputeNullable",
"org.apache.doris.nereids.trees.expressions.functions.PropagateNullable"
);

private final JavaAstAnalyzer analyzer;

public ExpressionTypeMappingGenerator(JavaAstAnalyzer javaAstAnalyzer) {
Expand Down Expand Up @@ -134,6 +153,10 @@ private String generateCode(Map<String, Set<String>> childrenNameMap,
+ " = ImmutableMap.builderWithExpectedSize(" + childrenNameMap.size() + ");\n";

for (String superExpression : superExpressions) {
if (FORBIDDEN_CLASS.contains(superExpression)) {
continue;
}

Set<String> childrenClasseSet = childrenNameMap.get(superExpression)
.stream()
.filter(childClass -> parentNameMap.get(childClass)
Expand Down

0 comments on commit a4c328c

Please sign in to comment.