Skip to content

Commit

Permalink
[fix](compile) fix fe compile failed by code too large (#46408)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

fix fe compile failed by code too large
  • Loading branch information
924060929 authored Jan 3, 2025
1 parent 3c9b29a commit 8f87a96
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 8f87a96

Please sign in to comment.