[ 
https://issues.apache.org/jira/browse/HIVE-26123?focusedWorklogId=755139&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-755139
 ]

ASF GitHub Bot logged work on HIVE-26123:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Apr/22 09:10
            Start Date: 11/Apr/22 09:10
    Worklog Time Spent: 10m 
      Work Description: 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...





Issue Time Tracking
-------------------

    Worklog Id:     (was: 755139)
    Time Spent: 50m  (was: 40m)

> Introduce test coverage for sysdb for the different metastores
> --------------------------------------------------------------
>
>                 Key: HIVE-26123
>                 URL: https://issues.apache.org/jira/browse/HIVE-26123
>             Project: Hive
>          Issue Type: Test
>          Components: Testing Infrastructure
>    Affects Versions: 4.0.0-alpha-2
>            Reporter: Alessandro Solimando
>            Assignee: Alessandro Solimando
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-2
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> _sydb_ exposes (some of) the metastore tables from Hive via JDBC queries. 
> Existing tests are running only against Derby, meaning that any change 
> against sysdb query mapping is not covered by CI.
> The present ticket aims at bridging this gap by introducing test coverage for 
> the different supported metastore for sydb.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to