Hive
  1. Hive
  2. HIVE-2381

SQLException thrown when the resultset becomes empty.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.7.1
    • Fix Version/s: None
    • Component/s: JDBC
    • Labels:
      None

      Description

      Using the next method on my HiveQueryResultSet, when the resultset becomes emtpy, a SQLException is thrown on this line of code:

      rowStr = (String) client.fetchOne();
      ...
      ...
      } catch (Exception ex) {
            ex.printStackTrace();
            throw new SQLException("Error retrieving next row");
          }
      

        Activity

        Hide
        Masato Setoyama added a comment -

        Excuse me for my poor English..

        I experienced the same error when I used JDBC Driver through Pentaho Report Designer 'Preview'.

        Maybe, below is error occuring point.

        } catch (HiveServerException e) {
        if (e.getErrorCode() == 0)

        { // error code == 0 means reached the EOF return false; }

        else

        { throw new SQLException("Error retrieving next row", e); }

        }

        In Pentaho Report Designer, Users can set Max Preview Row.
        So I set the max preview row number smaller than the actual row number the hive table had,
        then the error did'nt occured.
        But when I didn't set the max preview row number, always the error occured.
        I think the HiveQueryResultSet class's 'next' method can't recognize EOF.

        --Environments
        Hadoop Distribution: CDH3u1
        Pentaho Enterprise Edition 4.1 GA
        Pnetaho Report Designer 3.8.3 GA

        Show
        Masato Setoyama added a comment - Excuse me for my poor English.. I experienced the same error when I used JDBC Driver through Pentaho Report Designer 'Preview'. Maybe, below is error occuring point. } catch (HiveServerException e) { if (e.getErrorCode() == 0) { // error code == 0 means reached the EOF return false; } else { throw new SQLException("Error retrieving next row", e); } } In Pentaho Report Designer, Users can set Max Preview Row. So I set the max preview row number smaller than the actual row number the hive table had, then the error did'nt occured. But when I didn't set the max preview row number, always the error occured. I think the HiveQueryResultSet class's 'next' method can't recognize EOF. --Environments Hadoop Distribution: CDH3u1 Pentaho Enterprise Edition 4.1 GA Pnetaho Report Designer 3.8.3 GA
        Hide
        Chinna Rao Lalam added a comment -

        I have executed this scenario
        select id from sampletable where id > 100;
        sampletable contains id's < 100 so my result set is empty and when i try resultset.next() it is not throwing any exception.

        Can u post what is the scenario.

        Show
        Chinna Rao Lalam added a comment - I have executed this scenario select id from sampletable where id > 100; sampletable contains id's < 100 so my result set is empty and when i try resultset.next() it is not throwing any exception. Can u post what is the scenario.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rémy DUBOIS
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development