Github user evans-ye commented on a diff in the pull request:
https://github.com/apache/bigtop/pull/370#discussion_r200163701
--- Diff: bigtop-tests/smoke-tests/hive/HiveJdbcGeneralTest.java ---
@@ -0,0 +1,392 @@
+
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.hive.service.cli.HiveSQLException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * THIS CLASS TESTS THE FOLLOWING ASPECTS OF HIVE:
+ *
+ * Connect to hive; Drop the tables if already there; Test Show Tables;
Create
+ * blank tables, both transactional and non, along with ORC format and
+ * partitions; Reprint the list of tables; Load File into HDFS; Load data
into
+ * tables; describe tables; Delete Uploaded File; Print table contents with
+ * various queries; Test Prepared and Callable Statements; Test Fetch
Sizes;
+ * Test ACID (UPDATE/INSERT/DELETE); View Partitions;
+ */
+public class HiveJdbcGeneralTest extends TestMethods {
+
+ static String hivePort = System.getenv("HIVE_PORT");
+ static String jdbcConnection = System.getenv("HIVE_JDBC_URL");
+ static Connection con;
+ String newTableName = "btest";
+
+ @BeforeClass
+ public static void onTimeSetup() throws Exception {
+ String username = System.getenv("HIVE_USER");
+ String password = System.getenv("HIVE_PASSWORD");
+ Properties connectionProps = new Properties();
+ connectionProps.put("user", username);
+ connectionProps.put("password", password);
+ Class.forName("org.apache.hive.jdbc.HiveDriver");
+ con = DriverManager.getConnection(
+ jdbcConnection + ":" + hivePort + "/default;", connectionProps);
+ }
+
+ @AfterClass
+ public static void oneTimeTearDown() throws Exception {
+ con.close();
+ }
+
+ @Test // (expected=java.sql.SQLDataException.class)
+ public void testHive() throws Exception {
+ final File f = new File(HiveJdbcGeneralTest.class.getProtectionDomain()
+ .getCodeSource().getLocation().getPath());
+ // String jdbcDriver = propertyValue("hive-site.xml",
+ // "javax.jdo.option.ConnectionDriverName");
+
+ // String qualifiedName = propertyValue("hdfs-site.xml",
+ // "dfs.internal.nameservices");
+ // String[] haNodes = propertyValue("hdfs-site.xml",
+ // "dfs.ha.namenodes."+qualifiedName).split(",");
+ // String primaryNode = haNodes[0];
--- End diff --
Why don't we remove these code block?
---