[ 
https://issues.apache.org/jira/browse/HIVE-16186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932702#comment-15932702
 ] 

Sushanth Sowmyan commented on HIVE-16186:
-----------------------------------------

Good spot, [~sankarh], I'd suggest further change though. Instead of this bit:

{noformat}
//Set the current last repl ID
404             eventTo = lastReplId;
{noformat}

where you change eventTo to be the last replicated id, I'd suggest leaving 
eventTo alone, as that is user-specified, and instead, change the dmd output to 
output the last replicated id as its range instead. i.e.:

{noformat}
407             writeOutput(
408                 Arrays.asList("incremental", String.valueOf(eventFrom), 
String.valueOf(eventTo)),
409                 dmd.getDumpFilePath());
410             dmd.setDump(DUMPTYPE.INCREMENTAL, eventFrom, eventTo, cmRoot);
411             dmd.write();
{noformat}

->

{noformat}
407             writeOutput(
408                 Arrays.asList("incremental", String.valueOf(eventFrom), 
String.valueOf(lastReplId)),
409                 dmd.getDumpFilePath());
410             dmd.setDump(DUMPTYPE.INCREMENTAL, eventFrom, lastReplId, 
cmRoot);
411             dmd.write();
{noformat}

I think this makes the intent very easy to read in code when approached later 
on, rather than a reader wondering why eventTo was changed.

(Also, looks like the buildbot didn't upload test results for this patch 
either, so having a new patch might trigger it to run again)

> REPL DUMP shows last event ID of the database even if we use LIMIT option.
> --------------------------------------------------------------------------
>
>                 Key: HIVE-16186
>                 URL: https://issues.apache.org/jira/browse/HIVE-16186
>             Project: Hive
>          Issue Type: Sub-task
>          Components: repl
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>              Labels: DR
>         Attachments: HIVE-16186.01.patch
>
>
> Looks like LIMIT option doesn't work well with REPL DUMP.
> 0: jdbc:hive2://localhost:10001/default> REPL DUMP default FROM 170 LIMIT 1;
> +--------------------------+---------------+
> |         dump_dir         | last_repl_id  |
> +--------------------------+---------------+
> | /tmp/dump/1489395053411  | 195           |
> +--------------------------+---------------+



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to