kgyrtkirk commented on code in PR #3196:
URL: https://github.com/apache/hive/pull/3196#discussion_r847106908


##########
itests/qtest/src/test/java/org/apache/hadoop/hive/cli/TestPostgresMetastoreCliDriver.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.hadoop.hive.cli;
+
+import org.apache.hadoop.hive.cli.control.CliAdapter;
+import org.apache.hadoop.hive.cli.control.CliConfigs;
+import org.apache.hadoop.hive.cli.control.SplitSupport;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.junit.runners.model.Statement;
+
+import java.io.File;
+import java.util.List;
+
+@RunWith(Parameterized.class)
+public class TestPostgresMetastoreCliDriver {
+
+  static CliAdapter adapter = new 
CliConfigs.PostgresMetastoreCliConfig().getCliAdapter();
+
+  private static final int N_SPLITS = 32;

Review Comment:
   seems like copy-paste ? do you know what you are doing?



##########
itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliConfigs.java:
##########
@@ -240,6 +240,101 @@ public MiniLlapLocalCliConfig() {
     }
   }
 
+  public static class PostgresMetastoreCliConfig extends AbstractCliConfig {
+    public PostgresMetastoreCliConfig() {
+      super(CoreCliDriver.class);
+      try {
+        setQueryDir("ql/src/test/queries/clientpositive");
+        includesFrom(testConfigProps, "ms.postgres.query.files");
+        setResultsDir("ql/src/test/results/clientpositive/mspostgres");
+        setLogDir("itests/qtest/target/qfile-results/mspostgres");
+        setInitScript("q_test_init.sql");
+        setCleanupScript("q_test_cleanup.sql");
+        setHiveConfDir("data/conf/llap");
+        setClusterType(MiniClusterType.LLAP);
+        setMetastoreType("postgres");
+      } catch (Exception e) {
+        throw new RuntimeException("can't construct cliconfig", e);
+      }
+    }
+  }
+
+  public static class MssqlMetastoreCliConfig extends AbstractCliConfig {
+    public MssqlMetastoreCliConfig() {
+      super(CoreCliDriver.class);
+      try {
+        setQueryDir("ql/src/test/queries/clientpositive");
+        includesFrom(testConfigProps, "ms.mssql.query.files");
+        setResultsDir("ql/src/test/results/clientpositive/msmssql");
+        setLogDir("itests/qtest/target/qfile-results/msmssql");
+        setInitScript("q_test_init.sql");
+        setCleanupScript("q_test_cleanup.sql");
+        setHiveConfDir("data/conf/llap");
+        setClusterType(MiniClusterType.LLAP);
+        setMetastoreType("mssql");
+      } catch (Exception e) {
+        throw new RuntimeException("can't construct cliconfig", e);
+      }
+    }
+  }
+
+  public static class OracleMetastoreCliConfig extends AbstractCliConfig {
+    public OracleMetastoreCliConfig() {
+      super(CoreCliDriver.class);
+      try {
+        setQueryDir("ql/src/test/queries/clientpositive");
+        includesFrom(testConfigProps, "ms.oracle.query.files");
+        setResultsDir("ql/src/test/results/clientpositive/msoracle");
+        setLogDir("itests/qtest/target/qfile-results/msoracle");
+        setInitScript("q_test_init.sql");
+        setCleanupScript("q_test_cleanup.sql");
+        setHiveConfDir("data/conf/llap");
+        setClusterType(MiniClusterType.LLAP);
+        setMetastoreType("oracle");
+      } catch (Exception e) {
+        throw new RuntimeException("can't construct cliconfig", e);
+      }
+    }
+  }
+
+  public static class MysqlMetastoreCliConfig extends AbstractCliConfig {
+    public MysqlMetastoreCliConfig() {
+      super(CoreCliDriver.class);
+      try {
+        setQueryDir("ql/src/test/queries/clientpositive");
+        includesFrom(testConfigProps, "ms.mysql.query.files");
+        setResultsDir("ql/src/test/results/clientpositive/msmysql");
+        setLogDir("itests/qtest/target/qfile-results/msmysql");
+        setInitScript("q_test_init.sql");
+        setCleanupScript("q_test_cleanup.sql");
+        setHiveConfDir("data/conf/llap");
+        setClusterType(MiniClusterType.LLAP);
+        setMetastoreType("mysql");
+      } catch (Exception e) {
+        throw new RuntimeException("can't construct cliconfig", e);
+      }
+    }
+  }
+
+  public static class MariadbMetastoreCliConfig extends AbstractCliConfig {
+    public MariadbMetastoreCliConfig() {
+      super(CoreCliDriver.class);

Review Comment:
   please find a better way instead of just copy pasting a bunch of stuff...



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to