sankarh commented on a change in pull request #625: HIVE-21722 : REPL::END 
event log is not included in hiveStatement.getQueryLog output.
URL: https://github.com/apache/hive/pull/625#discussion_r283379331
 
 

 ##########
 File path: 
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java
 ##########
 @@ -2793,6 +2795,124 @@ public void run() {
     verifyFetchedLog(incrementalLogs, expectedLogs);
   }
 
+  private static  int next = 0;
+  private synchronized void advanceDumpDir() {
+    next++;
+    ReplDumpWork.injectNextDumpDirForTest(String.valueOf(next));
+  }
+
+  /**
+   * Test getting query log method in Jdbc for REPL commands
+   * @throws Exception
+   */
+  @Test
+  public void testGetQueryLogForReplCommands() throws Exception {
+    // Prepare
+    String primaryDb = "primaryDb";
+    String replicaDb = "replicaDb";
+    String primaryTblName = "primaryDb.t1";
+    String sql = "select count(*) from " + tableName;
+    Path replDir = new Path(conf.get("test.data.files"));
+    replDir = new Path(replDir, "repl");
+    FileSystem fs = FileSystem.get(replDir.toUri(), conf);
+    fs.mkdirs(replDir);
+
+    // Prepare
+    HiveStatement stmt = (HiveStatement)con.createStatement();
+    assertNotNull("Statement is null", stmt);
+    stmt.execute("set hive.exec.parallel = true");
+    stmt.execute("set hive.server2.logging.operation.level = execution");
+    stmt.execute("set hive.metastore.transactional.event.listeners = 
org.apache.hive.hcatalog.listener.DbNotificationListener");
+    stmt.execute("set hive.metastore.dml.events = true");
+    stmt.execute("create database " + primaryDb + " with 
dbproperties('repl.source.for'='1,2,3')");
+    stmt.execute("create table " + primaryTblName + " (id int)");
+    stmt.execute("insert into " + primaryTblName + " values (1), (2)");
+    stmt.close();
+
+    // Test query logs for bootstrap dump and load
+    String[] expectedBootstrapDumpLogs = {
+            "REPL::START",
 
 Review comment:
   Have check style issues in all these expected logs string initialisation.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to