yimengael commented on code in PR #1873: URL: https://github.com/apache/ignite-3/pull/1873#discussion_r1161487049
########## modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/table/AbstractTestTable.java: ########## @@ -0,0 +1,300 @@ +/* + * 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.ignite.internal.sql.engine.table; + +import java.util.Arrays; +import java.util.BitSet; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; +import org.apache.calcite.config.CalciteConnectionConfig; +import org.apache.calcite.plan.RelOptCluster; +import org.apache.calcite.plan.RelOptTable; +import org.apache.calcite.rel.RelCollation; +import org.apache.calcite.rel.RelDistribution; +import org.apache.calcite.rel.RelReferentialConstraint; +import org.apache.calcite.rel.hint.RelHint; +import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeFactory; +import org.apache.calcite.rel.type.RelDataTypeImpl; +import org.apache.calcite.rel.type.RelProtoDataType; +import org.apache.calcite.rex.RexNode; +import org.apache.calcite.schema.Schema; +import org.apache.calcite.schema.Statistic; +import org.apache.calcite.sql.SqlCall; +import org.apache.calcite.sql.SqlNode; +import org.apache.calcite.util.ImmutableBitSet; +import org.apache.ignite.internal.schema.BinaryRow; +import org.apache.ignite.internal.sql.engine.exec.ExecutionContext; +import org.apache.ignite.internal.sql.engine.exec.RowHandler.RowFactory; +import org.apache.ignite.internal.sql.engine.metadata.ColocationGroup; +import org.apache.ignite.internal.sql.engine.prepare.MappingQueryContext; +import org.apache.ignite.internal.sql.engine.rel.logical.IgniteLogicalIndexScan; +import org.apache.ignite.internal.sql.engine.rel.logical.IgniteLogicalTableScan; +import org.apache.ignite.internal.sql.engine.schema.IgniteIndex; +import org.apache.ignite.internal.sql.engine.schema.IgniteTable; +import org.apache.ignite.internal.sql.engine.schema.TableDescriptor; +import org.apache.ignite.internal.sql.engine.trait.IgniteDistribution; +import org.apache.ignite.internal.sql.engine.trait.TraitUtils; +import org.apache.ignite.internal.table.InternalTable; +import org.jetbrains.annotations.Nullable; + +/** + * AbstractTestTable. + * TODO Documentation + */ +public class AbstractTestTable implements IgniteTable { Review Comment: @zstan The problem that the class `org.apache.ignite.internal.sql.engine.framework.TestTable` is causing is that it is specifically used for some other classes and not for all the classes in `planner` packages. Trying to merge the class `AbstractTestTable` and TestTable will cause lots of tests to fail because of the reasons I gave above. Short term solution : I found was to separate the two classes `org.apache.ignite.internal.sql.engine.framework.TestTable` and `org.apache.ignite.internal.sql.engine.table.AbstractTestTable`, so that each of them can achieve its primary goal. Long term solution : Identifying all the use cases of the TestTable in the code, list of the different distributions used by each type of TestTable, Using a decorator pattern to create an abstraction of the TestTable that can be used all over the test Framework. This I will not consider this as an easy. This `org.apache.ignite.internal.sql.engine.table.AbstractTestTable` is not an abstract class, it is juts a naming to make different from the other TestTable `org.apache.ignite.internal.sql.engine.framework.TestTable`. -- 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]
