vvysotskyi commented on a change in pull request #1826: DRILL-7272: Drill Metastore Read / Write API and Drill Iceberg Metastore implementation URL: https://github.com/apache/drill/pull/1826#discussion_r304576938
########## File path: metastore/metastore-api/src/main/java/org/apache/drill/metastore/expressions/SimplePredicate.java ########## @@ -0,0 +1,168 @@ +/* + * 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.drill.metastore.expressions; + +import java.util.StringJoiner; + +/** + * Indicates simple predicate implementations which have reference and one value. + * + * @param <T> predicate value type + */ +public abstract class SimplePredicate<T> implements FilterExpression { + + private final String reference; + private final Operator operator; + private final T value; + + protected SimplePredicate(String reference, Operator operator, T value) { + this.reference = reference; + this.operator = operator; + this.value = value; + } + + public String reference() { + return reference; + } + + public T value() { + return value; + } + + @Override + public Operator operator() { + return operator; + } + + @Override + public String toString() { + return new StringJoiner(", ", SimplePredicate.class.getSimpleName() + "[", "]") + .add("reference=" + reference) + .add("operator=" + operator) + .add("value=" + value) + .toString(); + } + + /** + * Indicates {@link FilterExpression.Operator#EQUAL} operator expression: + * storagePlugin = 'dfs'. + * + * @param <T> expression value type + */ + public static class Equal<T> extends SimplePredicate<T>{ Review comment: ```suggestion public static class Equal<T> extends SimplePredicate<T> { ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
