Review Board 1.7.22


HIVE-4510

Review Request #10977 - Created May 7, 2013 and updated

Thejas Nair
HIVE-4510
Reviewers
hive
cws
hive-git
HIVE-4510 - HIVE-4510.2.patch

 
jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
Revision 775ebee New Change
[20] 226 lines
[+20] [+] public Date getDate(int columnIndex) throws SQLException {
227

    
   
227

   
228
    try {
228
    try {
229
      return Date.valueOf((String) obj);
229
      return Date.valueOf((String) obj);
230
    } catch (Exception e) {
230
    } catch (Exception e) {
231
      throw new SQLException("Cannot convert column " + columnIndex
231
      throw new SQLException("Cannot convert column " + columnIndex
232
              + " to date: " + e.toString());
232
              + " to date: " + e.toString(), e);
233
    }
233
    }
234
  }
234
  }
235

    
   
235

   
236
  public Date getDate(String columnName) throws SQLException {
236
  public Date getDate(String columnName) throws SQLException {
237
    return getDate(findColumn(columnName));
237
    return getDate(findColumn(columnName));
[+20] [20] 18 lines
[+20] [+] public double getDouble(int columnIndex) throws SQLException {
256
        return Double.valueOf((String)obj);
256
        return Double.valueOf((String)obj);
257
      }
257
      }
258
      throw new Exception("Illegal conversion");
258
      throw new Exception("Illegal conversion");
259
    } catch (Exception e) {
259
    } catch (Exception e) {
260
      throw new SQLException("Cannot convert column " + columnIndex
260
      throw new SQLException("Cannot convert column " + columnIndex
261
              + " to double: " + e.toString());
261
              + " to double: " + e.toString(), e);
262
    }
262
    }
263
  }
263
  }
264

    
   
264

   
265
  public double getDouble(String columnName) throws SQLException {
265
  public double getDouble(String columnName) throws SQLException {
266
    return getDouble(findColumn(columnName));
266
    return getDouble(findColumn(columnName));
[+20] [20] 18 lines
[+20] [+] public float getFloat(int columnIndex) throws SQLException {
285
        return Float.valueOf((String)obj);
285
        return Float.valueOf((String)obj);
286
      }
286
      }
287
      throw new Exception("Illegal conversion");
287
      throw new Exception("Illegal conversion");
288
    } catch (Exception e) {
288
    } catch (Exception e) {
289
      throw new SQLException("Cannot convert column " + columnIndex
289
      throw new SQLException("Cannot convert column " + columnIndex
290
              + " to float: " + e.toString());
290
              + " to float: " + e.toString(), e);
291
    }
291
    }
292
  }
292
  }
293

    
   
293

   
294
  public float getFloat(String columnName) throws SQLException {
294
  public float getFloat(String columnName) throws SQLException {
295
    return getFloat(findColumn(columnName));
295
    return getFloat(findColumn(columnName));
[+20] [20] 13 lines
[+20] [+] public int getInt(int columnIndex) throws SQLException {
309
      } else if (String.class.isInstance(obj)) {
309
      } else if (String.class.isInstance(obj)) {
310
        return Integer.valueOf((String)obj);
310
        return Integer.valueOf((String)obj);
311
      }
311
      }
312
      throw new Exception("Illegal conversion");
312
      throw new Exception("Illegal conversion");
313
    } catch (Exception e) {
313
    } catch (Exception e) {
314
      throw new SQLException("Cannot convert column " + columnIndex + " to integer" + e.toString());
314
      throw new SQLException(

    
   
315
          "Cannot convert column " + columnIndex + " to integer" + e.toString(),

    
   
316
          e);
315
    }
317
    }
316
  }
318
  }
317

    
   
319

   
318
  public int getInt(String columnName) throws SQLException {
320
  public int getInt(String columnName) throws SQLException {
319
    return getInt(findColumn(columnName));
321
    return getInt(findColumn(columnName));
[+20] [20] 9 lines
[+20] [+] public long getLong(int columnIndex) throws SQLException {
329
      } else if (String.class.isInstance(obj)) {
331
      } else if (String.class.isInstance(obj)) {
330
        return Long.valueOf((String)obj);
332
        return Long.valueOf((String)obj);
331
      }
333
      }
332
      throw new Exception("Illegal conversion");
334
      throw new Exception("Illegal conversion");
333
    } catch (Exception e) {
335
    } catch (Exception e) {
334
      throw new SQLException("Cannot convert column " + columnIndex + " to long: " + e.toString());
336
      throw new SQLException(

    
   
337
          "Cannot convert column " + columnIndex + " to long: " + e.toString(),

    
   
338
          e);
335
    }
339
    }
336
  }
340
  }
337

    
   
341

   
338
  public long getLong(String columnName) throws SQLException {
342
  public long getLong(String columnName) throws SQLException {
339
    return getLong(findColumn(columnName));
343
    return getLong(findColumn(columnName));
[+20] [20] 236 lines
[+20] [+] public short getShort(int columnIndex) throws SQLException {
576
        return Short.valueOf((String)obj);
580
        return Short.valueOf((String)obj);
577
      }
581
      }
578
      throw new Exception("Illegal conversion");
582
      throw new Exception("Illegal conversion");
579
    } catch (Exception e) {
583
    } catch (Exception e) {
580
      throw new SQLException("Cannot convert column " + columnIndex
584
      throw new SQLException("Cannot convert column " + columnIndex
581
              + " to short: " + e.toString());
585
              + " to short: " + e.toString(), e);
582
    }
586
    }
583
  }
587
  }
584

    
   
588

   
585
  public short getShort(String columnName) throws SQLException {
589
  public short getShort(String columnName) throws SQLException {
586
    return getShort(findColumn(columnName));
590
    return getShort(findColumn(columnName));
[+20] [20] 534 lines
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Revision 17b4d39 New Change
 
jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java
Revision 52192c4 New Change
 
jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
Revision aeae800 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/Driver.java
Revision 5bf93cc New Change
 
service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java
Revision 60148cb New Change
 
service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
Revision 2fee93e New Change
 
  1. jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java: Loading...
  2. jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java: Loading...
  3. jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java: Loading...
  4. jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java: Loading...
  5. ql/src/java/org/apache/hadoop/hive/ql/Driver.java: Loading...
  6. service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java: Loading...
  7. service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java: Loading...