JingDas commented on code in PR #21855: URL: https://github.com/apache/doris/pull/21855#discussion_r1329745818
########## fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/PlaceholderExpression.java: ########## @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.analyzer; + +import org.apache.doris.nereids.parser.trino.TrinoFnCallTransformer.PlaceholderCollector; +import org.apache.doris.nereids.trees.expressions.Expression; +import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Expression placeHolder, the expression in PlaceHolderExpression will be collected by + * + * @see PlaceholderCollector + */ +public class PlaceholderExpression extends Expression { + + private final Class<? extends Expression> delegateClazz; + /** + * 1 based + */ + private final int position; + + public PlaceholderExpression(List<Expression> children, Class<? extends Expression> delegateClazz, int position) { + super(children); + this.delegateClazz = delegateClazz; + this.position = position; + } + + public static PlaceholderExpression of(Class<? extends Expression> delegateClazz, int position) { + return new PlaceholderExpression(new ArrayList<>(), delegateClazz, position); + } + + @Override + public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { + return visitor.visit(this, context); + } + + public Class<? extends Expression> getDelegateClazz() { + return delegateClazz; + } + + public int getPosition() { + return position; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + PlaceholderExpression that = (PlaceholderExpression) o; + return position == that.position && Objects.equals(delegateClazz, that.delegateClazz); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), delegateClazz, position); + } + + @Override + public boolean nullable() { + return false; + } Review Comment: Have fixed it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org