walterddr commented on code in PR #9765: URL: https://github.com/apache/pinot/pull/9765#discussion_r1018518804
########## pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/QueryTestExecutor.java: ########## @@ -0,0 +1,171 @@ +/** + * 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.pinot.query.runtime.queries; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.ImmutableList; +import java.io.File; +import java.net.URL; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.pinot.common.datatable.DataTableFactory; +import org.apache.pinot.core.common.datatable.DataTableBuilderFactory; +import org.apache.pinot.query.QueryEnvironmentTestBase; +import org.apache.pinot.query.QueryServerEnclosure; +import org.apache.pinot.query.mailbox.GrpcMailboxService; +import org.apache.pinot.query.routing.WorkerInstance; +import org.apache.pinot.query.runtime.QueryRunnerTestBase; +import org.apache.pinot.query.service.QueryConfig; +import org.apache.pinot.query.testutils.MockInstanceDataManagerFactory; +import org.apache.pinot.query.testutils.QueryTestUtils; +import org.apache.pinot.spi.config.table.TableType; +import org.apache.pinot.spi.data.Schema; +import org.apache.pinot.spi.env.PinotConfiguration; +import org.apache.pinot.spi.utils.builder.TableNameBuilder; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + + +public class QueryTestExecutor extends QueryRunnerTestBase { + private static final ObjectMapper MAPPER = new ObjectMapper(); + private static final Pattern TABLE_NAME_REPLACE_PATTERN = Pattern.compile("\\{([\\w\\d]+)\\}"); + private static final String QUERY_TEST_RESOURCE_FOLDER = "queries"; + private static final List<String> QUERY_TEST_RESOURCE_FILES = ImmutableList.of( + "BasicQuery.json" + ); + + @BeforeClass + public void setUp() + throws Exception { + DataTableBuilderFactory.setDataTableVersion(DataTableFactory.VERSION_4); + // Setting up mock server factories. + MockInstanceDataManagerFactory factory1 = new MockInstanceDataManagerFactory("server1"); + MockInstanceDataManagerFactory factory2 = new MockInstanceDataManagerFactory("server2"); + // Setting up H2 for validation + setH2Connection(); + + // Scan through all the test cases. + for (Map.Entry<String, TestCase> testCaseEntry : getTestCases().entrySet()) { Review Comment: unfortunately no we still need to preregister. let's revisit if this becomes a bottleneck ########## pinot-query-runtime/src/test/resources/queries/BasicQuery.json: ########## @@ -0,0 +1,39 @@ + +{ + "basic_test": { + "description": "basic test case example", + "sql": "SELECT * FROM {tbl}", + "tables": { + "tbl": { "col1": "STRING", "col2": "INT" } Review Comment: done -- 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...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org