Permalink
Browse files

MAPREDUCE-6012. DBInputSplit creates invalid ranges on Oracle. (Wei Y…

…an via kasha)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1618699 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
kambatla committed Aug 18, 2014
1 parent b43e595 commit 9fb9c5f9842fb82625b18004a0d4ec98ddb62944
Showing with 6 additions and 4 deletions.
  1. +3 −0 CHANGES.txt
  2. +3 −4 src/mapred/org/apache/hadoop/mapreduce/lib/db/OracleDBRecordReader.java
View
@@ -239,6 +239,9 @@ Release 1.3.0 - unreleased
HDFS-6822. Namenode and datanode fails to replace "_HOST" to hostname for
hadoop.http.authentication.kerberos.principal. (jing9)
+ MAPREDUCE-6012. DBInputSplit creates invalid ranges on Oracle.
+ (Wei Yan via kasha)
+
Release 1.2.2 - unreleased
INCOMPATIBLE CHANGES
@@ -81,15 +81,14 @@ protected String getSelectQuery() {
try {
DBInputFormat.DBInputSplit split = getSplit();
- if (split.getLength() > 0 && split.getStart() > 0){
+ if (split.getLength() > 0){
String querystring = query.toString();
query = new StringBuilder();
query.append("SELECT * FROM (SELECT a.*,ROWNUM dbif_rno FROM ( ");
query.append(querystring);
- query.append(" ) a WHERE rownum <= ").append(split.getStart());
- query.append(" + ").append(split.getLength());
- query.append(" ) WHERE dbif_rno >= ").append(split.getStart());
+ query.append(" ) a WHERE rownum <= ").append(split.getEnd());
+ query.append(" ) WHERE dbif_rno > ").append(split.getStart());
}
} catch (IOException ex) {
// ignore, will not throw.

0 comments on commit 9fb9c5f

Please sign in to comment.