rdblue commented on a change in pull request #1631:
URL: https://github.com/apache/iceberg/pull/1631#discussion_r508010813



##########
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:
       Do you know how the metastore connections are handled in HS2? Does each 
HS2 service have a connection pool? Or are connections created per session?
   
   Why did you choose to use a session per test case? Is that to avoid some 
sort of state leak? Are sessions not supposed to be used concurrently?




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

Reply via email to