beryllw commented on code in PR #1523: URL: https://github.com/apache/fluss/pull/1523#discussion_r2266717107
########## fluss-lake/fluss-lake-paimon/src/main/java/com/alibaba/fluss/lake/paimon/utils/PredicateConverter.java: ########## @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2025 Alibaba Group Holding Ltd. + * + * Licensed 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 com.alibaba.fluss.lake.paimon.utils; + +import com.alibaba.fluss.predicate.And; +import com.alibaba.fluss.predicate.CompoundPredicate; +import com.alibaba.fluss.predicate.FieldRef; +import com.alibaba.fluss.predicate.FunctionVisitor; +import com.alibaba.fluss.predicate.LeafPredicate; +import com.alibaba.fluss.predicate.Or; +import com.alibaba.fluss.predicate.PredicateVisitor; + +import org.apache.paimon.predicate.Predicate; +import org.apache.paimon.predicate.PredicateBuilder; +import org.apache.paimon.types.RowType; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * Converts a Fluss {@link com.alibaba.fluss.predicate.Predicate} into a Paimon {@link Predicate}. + * + * <p>This class implements the {@link PredicateVisitor} pattern to traverse a tree of Fluss + * predicates. It handles both leaf-level conditions (like equals, greater than) and compound + * conditions (AND, OR). + */ +public class PredicateConverter implements PredicateVisitor<Predicate> { Review Comment: May be `PaimonPredicateConverter` is better? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
