maheshk114 commented on a change in 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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]