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

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

                Author: ASF GitHub Bot
            Created on: 08/Jul/19 07:03
            Start Date: 08/Jul/19 07:03
    Worklog Time Spent: 10m 
      Work Description: maheshk114 commented on pull request #705: HIVE-21958 : 
The list of table expression in the inclusion and exclusion list should be 
separated by '|' instead of comma.
URL: https://github.com/apache/hive/pull/705#discussion_r300947209
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/DumpMetaData.java
 ##########
 @@ -85,48 +85,27 @@ private void readReplScope(String line) throws IOException 
{
     }
 
     String[] lineContents = line.split("\t");
-    if (lineContents.length < 1) {
-      return;
-    }
-
     replScope = new ReplScope();
-
-    LOG.info("Read ReplScope: Set Db Name: {}.", lineContents[0]);
-    replScope.setDbName(lineContents[0]);
-
-    // Read/set include and exclude tables list.
-    int idx = readReplScopeTablesList(lineContents, 1, true);
-    readReplScopeTablesList(lineContents, idx, false);
-  }
-
-  private int readReplScopeTablesList(String[] lineContents, int startIdx, 
boolean includeList)
-          throws IOException {
-    // If the list doesn't exist, then return.
-    if (startIdx >= lineContents.length) {
-      return startIdx;
-    }
-
-    // Each tables list should start with "{" and ends with "}"
-    if (!"{".equals(lineContents[startIdx])) {
-      throw new IOException("Invalid repl tables list data in dump metadata 
file. Missing \"{\".");
-    }
-
-    List<String>tableNames = new ArrayList<>();
-    for (int i = (startIdx + 1); i < lineContents.length; i++) {
-      String value = lineContents[i];
-      if ("}".equals(value)) {
-        if (includeList) {
-          LOG.info("Read ReplScope: Set Include Table Names: {}.", tableNames);
-          replScope.setIncludedTablePatterns(tableNames);
-        } else {
-          LOG.info("Read ReplScope: Set Exclude Table Names: {}.", tableNames);
-          replScope.setExcludedTablePatterns(tableNames);
-        }
-        return (i + 1);
+    for (int idx = 0; idx < lineContents.length; idx++) {
+      String value = lineContents[idx];
+      switch (idx) {
+        case 0:
+          LOG.info("Read ReplScope: Set Db Name: {}.", value);
+          replScope.setDbName(value);
+          break;
+        case 1:
+          LOG.info("Read ReplScope: Include table name list: {}.", value);
+          replScope.setIncludedTablePatterns(value);
+          break;
+        case 2:
+          LOG.info("Read ReplScope: Exclude table name list: {}.", value);
+          replScope.setExcludedTablePatterns(value);
+          break;
+        default:
+          LOG.warn("Found invalid info " + value + " in the repl dump file 
while reading ReplScope");
 
 Review comment:
   done
 
----------------------------------------------------------------
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


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

    Worklog Id:     (was: 273096)
    Time Spent: 1.5h  (was: 1h 20m)

> The list of table expression in the inclusion and exclusion list should be 
> separated by '|' instead of comma.
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-21958
>                 URL: https://issues.apache.org/jira/browse/HIVE-21958
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: mahesh kumar behera
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21958.01.patch, HIVE-21958.02.patch, 
> HIVE-21958.03.patch
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Java regex expression does not support comma. If user wants multiple 
> expression to be present in the include or exclude list, then the expressions 
> can be provided separated by pipe ('|') character. The policy will look 
> something like db_name.'(t1*)|(t3)'.'t100'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to