Review Board 1.7.22


SQOOP-860 NullPointerException when running procedure export against old database

Review Request #9211 - Created Feb. 1, 2013 and submitted

Jarek Cecho
SQOOP-860
Reviewers
Sqoop
sqoop-trunk
Instead of returning null, I've changed the code to re-throw the exception.
I've done testing against old PostgreSQL instance where I detected original NPE, I'm now getting RuntimeException as expected.

Diff revision 1 (Latest)

  1. src/java/org/apache/sqoop/manager/SqlManager.java: Loading...
src/java/org/apache/sqoop/manager/SqlManager.java
Revision 03c9e64d3a08a2ef6a1b38720e67f7d2569b93c2 New Change
[20] 196 lines
[+20] [+] public String[] getColumnNamesForProcedure(String procedureName) {
197
        return ret.toArray(new String[ret.size()]);
197
        return ret.toArray(new String[ret.size()]);
198
      } finally {
198
      } finally {
199
        results.close();
199
        results.close();
200
        getConnection().commit();
200
        getConnection().commit();
201
      }
201
      }
202
    } catch (SQLException sqlException) {
202
    } catch (SQLException e) {
203
      LOG.error("Error reading procedure metadata: "
203
      LOG.error("Error reading procedure metadata: ", e);
204
          + sqlException.toString());
204
      throw new RuntimeException("Can't fetch column names for procedure.", e);
205
      return null;

   
206
    }
205
    }
207
  }
206
  }
208

    
   
207

   
209
  /**
208
  /**
210
   * @return the SQL query to use in getColumnTypes() in case this logic must
209
   * @return the SQL query to use in getColumnTypes() in case this logic must
[+20] [20] 764 lines
  1. src/java/org/apache/sqoop/manager/SqlManager.java: Loading...