You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ni...@apache.org on 2017/04/20 14:03:15 UTC

ambari git commit: AMBARI-19666 : Fixed Hive view loosing one row every 100 row in result set. (nitirajrathore)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 bf491bced -> c8b164a75


AMBARI-19666 : Fixed Hive view loosing one row every 100 row in result set. (nitirajrathore)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c8b164a7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c8b164a7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c8b164a7

Branch: refs/heads/branch-2.4
Commit: c8b164a7593b989c147cc9f516c98cff1884df5d
Parents: bf491bc
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Thu Apr 20 19:32:17 2017 +0530
Committer: Nitiraj Singh Rathore <ni...@gmail.com>
Committed: Thu Apr 20 19:32:17 2017 +0530

----------------------------------------------------------------------
 .../org/apache/ambari/view/hive2/actor/ResultSetIterator.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c8b164a7/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
index 1052bd4..5bde12d 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
@@ -116,7 +116,8 @@ public class ResultSetIterator extends HiveActor {
     }
     int index = 0;
     try {
-      while (resultSet.next() && index < batchSize) {
+      // check batchsize first becaue resultSet.next() fetches the new row as well before returning true/false.
+      while (index < batchSize && resultSet.next()) {
         index++;
         rows.add(getRowFromResultSet(resultSet));
       }