zstan commented on code in PR #13068:
URL: https://github.com/apache/ignite/pull/13068#discussion_r3208607781


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/tpc/AbstractTpcQueryPlannerTest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * 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.processors.query.calcite.planner.tpc;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UncheckedIOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import com.google.common.io.CharStreams;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.sql.SqlExplainLevel;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.cache.query.FieldsQueryCursor;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
+import org.apache.ignite.calcite.CalciteQueryEngineConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgnitionEx;
+import 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor;
+import 
org.apache.ignite.internal.processors.query.calcite.integration.tpch.TpchHelper;
+import 
org.apache.ignite.internal.processors.query.calcite.planner.AbstractPlannerTest;
+import 
org.apache.ignite.internal.processors.query.calcite.planner.tpc.PlanChecker.AfterPlansTest;
+import 
org.apache.ignite.internal.processors.query.calcite.planner.tpc.PlanChecker.BeforePlansTest;
+import 
org.apache.ignite.internal.processors.query.calcite.prepare.PlanningContext;
+import org.apache.ignite.internal.processors.query.calcite.schema.IgniteSchema;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.junit.Test;
+import org.junit.runners.Parameterized;
+
+import static 
org.apache.ignite.internal.processors.query.calcite.planner.tpc.PlanChecker.RSRC_DIR;
+import static 
org.apache.ignite.internal.processors.query.calcite.planner.tpc.PlanChecker.sqlTestName;
+
+/**
+ * Abstract test class to ensure a planner generates expected plan for TPC 
queries.
+ */
+public class AbstractTpcQueryPlannerTest extends AbstractPlannerTest {
+    /** Set to {@code true} to write plan files, instead of checking. */
+    private static final boolean UPDATE_PLAN = false;
+
+    /** Server node to run queries on. */
+    private static IgniteEx srv;
+
+    /** Query id. Set by {@link PlanChecker}. */
+    @Parameterized.Parameter
+    public String queryId;
+
+    /** Run once, before all queries check. */
+    @BeforePlansTest
+    public static void startAll(Class<?> testClass) throws Exception {
+        AbstractTpcQueryPlannerTest mock = new AbstractTpcQueryPlannerTest();
+
+        mock.beforeFirstTest();
+
+        IgniteConfiguration cfg = mock.getConfiguration("server");
+
+        cfg.getSqlConfiguration()
+            .setQueryEnginesConfiguration(new 
CalciteQueryEngineConfiguration().setDefault(true));
+
+        srv = (IgniteEx)IgnitionEx.start(cfg);
+
+        srv.getOrCreateCache(new CacheConfiguration<>("mock")
+            .setSqlFunctionClasses(AbstractTpcQueryPlannerTest.TpchUDF.class)
+            .setSqlSchema("PUBLIC"));
+
+        TpchHelper.createTables(srv);
+
+/*
+        TpchHelper.fillTables(srv, 0.01);

Review Comment:
   seems it need to be fixed somehow ?



-- 
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]

Reply via email to