diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g index e9ccfd2..3dcb927 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g @@ -340,7 +340,6 @@ KW_MERGE: 'MERGE'; KW_MATCHED: 'MATCHED'; KW_REPL: 'REPL'; KW_DUMP: 'DUMP'; -KW_BATCH: 'BATCH'; KW_STATUS: 'STATUS'; // Operators diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g index 918169a..ea38019 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g @@ -393,7 +393,6 @@ TOK_UPDATE; TOK_DELETE;TOK_REPL_DUMP; TOK_REPL_LOAD; TOK_REPL_STATUS; -TOK_BATCH; TOK_TO; } @@ -795,9 +794,9 @@ replDumpStatement (dbName=identifier) (DOT tblName=identifier)? (KW_FROM (eventId=Number) (KW_TO (rangeEnd=Number))? - (KW_BATCH (batchSize=Number))? + (KW_LIMIT (batchSize=Number))? )? - -> ^(TOK_REPL_DUMP $dbName $tblName? ^(TOK_FROM $eventId (TOK_TO $rangeEnd)? (TOK_BATCH $batchSize)?)? ) + -> ^(TOK_REPL_DUMP $dbName $tblName? ^(TOK_FROM $eventId (TOK_TO $rangeEnd)? (TOK_LIMIT $batchSize)?)? ) ; replLoadStatement diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java index 79a6a45..358cf7a 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java @@ -94,7 +94,7 @@ private String tblNameOrPattern; private Long eventFrom; private Long eventTo; - private Integer batchSize; + private Integer maxEventLimit; // Base path for REPL LOAD private String path; @@ -276,8 +276,8 @@ private void initReplDump(ASTNode ast) { Long.parseLong(PlanUtils.stripQuotes(fromNode.getChild(numChild + 1).getText())); // skip the next child, since we already took care of it numChild++; - } else if (fromNode.getChild(numChild).getType() == TOK_BATCH) { - batchSize = + } else if (fromNode.getChild(numChild).getType() == TOK_LIMIT) { + maxEventLimit = Integer.parseInt(PlanUtils.stripQuotes(fromNode.getChild(numChild + 1).getText())); // skip the next child, since we already took care of it numChild++; @@ -297,7 +297,7 @@ private void initReplDump(ASTNode ast) { private void analyzeReplDump(ASTNode ast) throws SemanticException { LOG.debug("ReplicationSemanticAnalyzer.analyzeReplDump: " + String.valueOf(dbNameOrPattern) + "." + String.valueOf(tblNameOrPattern) + " from " + String.valueOf(eventFrom) + " to " - + String.valueOf(eventTo) + " batchsize " + String.valueOf(batchSize)); + + String.valueOf(eventTo) + " batchsize " + String.valueOf(maxEventLimit)); String replRoot = conf.getVar(HiveConf.ConfVars.REPLDIR); Path dumpRoot = new Path(replRoot, getNextDumpDir()); DumpMetaData dmd = new DumpMetaData(dumpRoot); @@ -354,11 +354,11 @@ private void analyzeReplDump(ASTNode ast) throws SemanticException { } Integer maxRange = Ints.checkedCast(eventTo - eventFrom + 1); - if (batchSize == null){ - batchSize = maxRange; + if (maxEventLimit == null){ + maxEventLimit = maxRange; } else { - if (batchSize > maxRange){ - batchSize = maxRange; + if (maxEventLimit > maxRange){ + maxEventLimit = maxRange; } } @@ -370,7 +370,7 @@ private void analyzeReplDump(ASTNode ast) throws SemanticException { = new EventUtils.MSClientNotificationFetcher(db.getMSC()); EventUtils.NotificationEventIterator evIter = new EventUtils.NotificationEventIterator( - evFetcher, eventFrom, batchSize, evFilter); + evFetcher, eventFrom, maxEventLimit, evFilter); while (evIter.hasNext()){ NotificationEvent ev = evIter.next();