marton-bod commented on a change in pull request #1631: URL: https://github.com/apache/iceberg/pull/1631#discussion_r511848026
########## File path: mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveShell.java ########## @@ -0,0 +1,173 @@ +/* + * 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.iceberg.mr.hive; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hive.service.cli.CLIService; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationHandle; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.SessionHandle; +import org.apache.hive.service.cli.session.HiveSession; +import org.apache.hive.service.server.HiveServer2; +import org.apache.iceberg.common.DynMethods; + +import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkState; + +/** + * Test class for running HiveQL queries, essentially acting like a Beeline shell in tests. + * + * It takes a metastore URL via conf, and spins up an HS2 instance which connects to it. The shell will only accept + * queries if it has been previously initialized via {@link #start()}, and a session has been opened via + * {@link #openSession()}. Prior to calling {@link #start()}, the shell should first be configured with props that apply + * across all test cases by calling {@link #setHiveConfValue(String, String)} ()}. On the other hand, session-level conf + * can be applied anytime via {@link #setHiveSessionValue(String, String)} ()}, once we've opened an active session. + */ +public class TestHiveShell { Review comment: The metastore client is cached in threadlocal, so each test method will create one and reuse it across its query executions (so not 1 connection per test suite but 1 per test method). However, since the connections are properly closed by calling `session.close()` at the end of each test method, I see no reason to keep the higher pool size. Changed it back to the default size. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org