hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhihai xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-6012) DBInputSplit creates invalid ranges on Oracle
Date Wed, 30 Jul 2014 00:38:38 GMT

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

zhihai xu commented on MAPREDUCE-6012:
--------------------------------------

[~ywskycn] 's patch looks good to me. His patch used getEnd() instead of getStart() + getLength();
in the SQL Query, which simplified the old code.

> DBInputSplit creates invalid ranges on Oracle
> ---------------------------------------------
>
>                 Key: MAPREDUCE-6012
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6012
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 1.2.1, 2.4.1
>            Reporter: Julien Serdaru
>            Assignee: Wei Yan
>         Attachments: HADOOP-9530.patch, MAPREDUCE-6012-branch-1.patch
>
>
> The DBInputFormat on Oracle does not create valid ranges.
> The method getSplit line 263 is as follows:
>           split = new DBInputSplit(i * chunkSize, (i * chunkSize) + chunkSize);
> So the first split will have a start value of 0 (0*chunkSize).
> However, the OracleDBRecordReader, line 84 is as follows:
>       if (split.getLength() > 0 && split.getStart() > 0){
> Since the start value of the first range is equal to 0, we will skip the block that partitions
the input set. As a result, one of the map task will process the entire data set, rather than
the partition.
> I'm assuming the fix is trivial and would involve removing the second check in the if
block.
> Also, I believe the OracleDBRecordReader paging query is incorrect.
> Line 92 should read:
>   query.append(" ) WHERE dbif_rno > ").append(split.getStart());
> instead of (note > instead of >=)
>   query.append(" ) WHERE dbif_rno >= ").append(split.getStart());
> Otherwise some rows will be ignored and some counted more than once.
> A map/reduce job that counts the number of rows based on a predicate will highlight the
incorrect behavior.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message