Review Board 1.7.22


Make JDBC use the new HiveServer2 async execution API by default

Review Request #14950 - Created Oct. 25, 2013 and updated

Vaibhav Gumashta
trunk
HIVE-5232
Reviewers
hive
prasadm, thejas
hive-git
Should be applied on top of:
HIVE-5217 [Add long polling to asynchronous execution in HiveServer2]
HIVE-5229 [Better thread management for HiveServer2 async threads]
HIVE-5230 [Better error reporting by async threads in HiveServer2]
HIVE-5441 [Async query execution doesn't return resultset status] 
TestJdbcDriver2

Diff revision 3 (Latest)

1 2 3
1 2 3

  1. jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java: Loading...
jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
Revision f0d0c77 New Change
[20] 94 lines
[+20] [+] public class HiveStatement implements java.sql.Statement {
95
   * (non-Javadoc)
95
   * (non-Javadoc)
96
   *
96
   *
97
   * @see java.sql.Statement#addBatch(java.lang.String)
97
   * @see java.sql.Statement#addBatch(java.lang.String)
98
   */
98
   */
99

    
   
99

   

    
   
100
  @Override
100
  public void addBatch(String sql) throws SQLException {
101
  public void addBatch(String sql) throws SQLException {
101
    throw new SQLException("Method not supported");
102
    throw new SQLException("Method not supported");
102
  }
103
  }
103

    
   
104

   
104
  /*
105
  /*
105
   * (non-Javadoc)
106
   * (non-Javadoc)
106
   *
107
   *
107
   * @see java.sql.Statement#cancel()
108
   * @see java.sql.Statement#cancel()
108
   */
109
   */
109

    
   
110

   

    
   
111
  @Override
110
  public void cancel() throws SQLException {
112
  public void cancel() throws SQLException {
111
    if (isClosed) {
113
    if (isClosed) {
112
      throw new SQLException("Can't cancel after statement has been closed");
114
      throw new SQLException("Can't cancel after statement has been closed");
113
    }
115
    }
114

    
   
116

   
[+20] [20] 17 lines
[+20] public void cancel() throws SQLException {
132
   * (non-Javadoc)
134
   * (non-Javadoc)
133
   *
135
   *
134
   * @see java.sql.Statement#clearBatch()
136
   * @see java.sql.Statement#clearBatch()
135
   */
137
   */
136

    
   
138

   

    
   
139
  @Override
137
  public void clearBatch() throws SQLException {
140
  public void clearBatch() throws SQLException {
138
    throw new SQLException("Method not supported");
141
    throw new SQLException("Method not supported");
139
  }
142
  }
140

    
   
143

   
141
  /*
144
  /*
142
   * (non-Javadoc)
145
   * (non-Javadoc)
143
   *
146
   *
144
   * @see java.sql.Statement#clearWarnings()
147
   * @see java.sql.Statement#clearWarnings()
145
   */
148
   */
146

    
   
149

   

    
   
150
  @Override
147
  public void clearWarnings() throws SQLException {
151
  public void clearWarnings() throws SQLException {
148
    warningChain = null;
152
    warningChain = null;
149
  }
153
  }
150

    
   
154

   
151
  void closeClientOperation() throws SQLException {
155
  void closeClientOperation() throws SQLException {
[+20] [20] 15 lines
[+20] public void clearWarnings() throws SQLException {
167
  /*
171
  /*
168
   * (non-Javadoc)
172
   * (non-Javadoc)
169
   *
173
   *
170
   * @see java.sql.Statement#close()
174
   * @see java.sql.Statement#close()
171
   */
175
   */

    
   
176
  @Override
172
  public void close() throws SQLException {
177
  public void close() throws SQLException {
173
    if (isClosed) {
178
    if (isClosed) {
174
      return;
179
      return;
175
    }
180
    }
176
    if (stmtHandle != null) {
181
    if (stmtHandle != null) {
[+20] [20] 13 lines
[+20] [+] public void closeOnCompletion() throws SQLException {
190
   * (non-Javadoc)
195
   * (non-Javadoc)
191
   *
196
   *
192
   * @see java.sql.Statement#execute(java.lang.String)
197
   * @see java.sql.Statement#execute(java.lang.String)
193
   */
198
   */
194

    
   
199

   

    
   
200
  @Override
195
  public boolean execute(String sql) throws SQLException {
201
  public boolean execute(String sql) throws SQLException {
196
    if (isClosed) {
202
    if (isClosed) {
197
      throw new SQLException("Can't execute after statement has been closed");
203
      throw new SQLException("Can't execute after statement has been closed");
198
    }
204
    }
199

    
   
205

   
200
    try {
206
    try {
201
      if (stmtHandle != null) {
207
      if (stmtHandle != null) {
202
        closeClientOperation();
208
        closeClientOperation();
203
      }
209
      }
204

    
   
210

   
205
      TExecuteStatementReq execReq = new TExecuteStatementReq(sessHandle, sql);
211
      TExecuteStatementReq execReq = new TExecuteStatementReq(sessHandle, sql);

    
   
212
      /**

    
   
213
       * Run asynchronously whenever possible

    
   
214
       * Currently only a SQLOperation can be run asynchronously,

    
   
215
       * in a background operation thread

    
   
216
       * Compilation is synchronous and execution is asynchronous

    
   
217
       */

    
   
218
      execReq.setRunAsync(true);
206
      execReq.setConfOverlay(sessConf);
219
      execReq.setConfOverlay(sessConf);
207
      TExecuteStatementResp execResp = client.ExecuteStatement(execReq);
220
      TExecuteStatementResp execResp = client.ExecuteStatement(execReq);
208
      Utils.verifySuccessWithInfo(execResp.getStatus());
221
      Utils.verifySuccessWithInfo(execResp.getStatus());
209
      stmtHandle = execResp.getOperationHandle();
222
      stmtHandle = execResp.getOperationHandle();
210
    } catch (SQLException eS) {
223
    } catch (SQLException eS) {
211
      throw eS;
224
      throw eS;
212
    } catch (Exception ex) {
225
    } catch (Exception ex) {
213
      throw new SQLException(ex.toString(), "08S01", ex);
226
      throw new SQLException(ex.toString(), "08S01", ex);
214
    }
227
    }
215

    
   
228

   
216
    if (!stmtHandle.isHasResultSet()) {

   
217
      // Poll until the query has completed one way or another. DML queries will not return a result

   
218
      // set, but we should not return from this method until the query has completed to avoid

   
219
      // racing with possible subsequent session shutdown, or queries that depend on the results

   
220
      // materialised here.

   
221
      TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle);
229
    TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle);
222
      boolean requestComplete = false;
230
    boolean operationComplete = false;
223
      while (!requestComplete) {
231
    TGetOperationStatusResp statusResp;

    
   
232

   

    
   
233
    // Poll on the operation status, till the operation is complete

    
   
234
    while (!operationComplete) {
224
        try {
235
      try {
225
          TGetOperationStatusResp statusResp = client.GetOperationStatus(statusReq);
236
        /**

    
   
237
         * For an async SQLOperation, GetOperationStatus will use the long polling approach

    
   
238
         * It will essentially return after the HIVE_SERVER2_LONG_POLLING_TIMEOUT (a server config) expires

    
   
239
         */

    
   
240
        statusResp = client.GetOperationStatus(statusReq);
226
          Utils.verifySuccessWithInfo(statusResp.getStatus());
241
        Utils.verifySuccessWithInfo(statusResp.getStatus());
227
          if (statusResp.isSetOperationState()) {
242
        if (statusResp.isSetOperationState()) {
228
            switch (statusResp.getOperationState()) {
243
          switch (statusResp.getOperationState()) {
229
            case CLOSED_STATE:
244
          case CLOSED_STATE:
230
            case FINISHED_STATE:
245
          case FINISHED_STATE:
231
              return false;
246
            operationComplete = true;

    
   
247
            break;
232
            case CANCELED_STATE:
248
          case CANCELED_STATE:
233
              // 01000 -> warning
249
            // 01000 -> warning
234
              throw new SQLException("Query was cancelled", "01000");
250
            throw new SQLException("Query was cancelled", "01000");
235
            case ERROR_STATE:
251
          case ERROR_STATE:
236
              // HY000 -> general error
252
            // Get the error details from the underlying exception
237
              throw new SQLException("Query failed", "HY000");
253
            throw new SQLException(statusResp.getErrorMessage(),

    
   
254
                statusResp.getSqlState(), statusResp.getErrorCode());
238
            case UKNOWN_STATE:
255
          case UKNOWN_STATE:
239
              throw new SQLException("Unknown query", "HY000");
256
            throw new SQLException("Unknown query", "HY000");
240
            case INITIALIZED_STATE:
257
          case INITIALIZED_STATE:
241
            case PENDING_STATE:
258
          case PENDING_STATE:
242
            case RUNNING_STATE:
259
          case RUNNING_STATE:
243
              break;
260
            break;
244
            }
261
          }
245
          }
262
        }
246
        } catch (Exception ex) {
263
      } catch (SQLException e) {
247
          throw new SQLException(ex.toString(), "08S01", ex);
264
        throw e;
248
        }
265
      } catch (Exception e) {
249

    
   
266
        throw new SQLException(e.toString(), "08S01", e);
250
        try {

   
251
          Thread.sleep(100);

   
252
        } catch (InterruptedException ex) {

   
253
          // Ignore

   
254
        }
267
      }
255
      }
268
    }

    
   
269

   

    
   
270
    // The query should be completed by now

    
   
271
    if (!stmtHandle.isHasResultSet()) {
256
      return false;
272
      return false;
257
    }
273
    }
258
    resultSet =  new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle)
274
    resultSet =  new HiveQueryResultSet.Builder(this).setClient(client).setSessionHandle(sessHandle)
259
        .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize)
275
        .setStmtHandle(stmtHandle).setMaxRows(maxRows).setFetchSize(fetchSize)
260
        .setScrollable(isScrollableResultset)
276
        .setScrollable(isScrollableResultset)
[+20] [20] 5 lines
[+20] public boolean execute(String sql) throws SQLException {
266
   * (non-Javadoc)
282
   * (non-Javadoc)
267
   *
283
   *
268
   * @see java.sql.Statement#execute(java.lang.String, int)
284
   * @see java.sql.Statement#execute(java.lang.String, int)
269
   */
285
   */
270

    
   
286

   

    
   
287
  @Override
271
  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
288
  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
272
    throw new SQLException("Method not supported");
289
    throw new SQLException("Method not supported");
273
  }
290
  }
274

    
   
291

   
275
  /*
292
  /*
276
   * (non-Javadoc)
293
   * (non-Javadoc)
277
   *
294
   *
278
   * @see java.sql.Statement#execute(java.lang.String, int[])
295
   * @see java.sql.Statement#execute(java.lang.String, int[])
279
   */
296
   */
280

    
   
297

   

    
   
298
  @Override
281
  public boolean execute(String sql, int[] columnIndexes) throws SQLException {
299
  public boolean execute(String sql, int[] columnIndexes) throws SQLException {
282
    throw new SQLException("Method not supported");
300
    throw new SQLException("Method not supported");
283
  }
301
  }
284

    
   
302

   
285
  /*
303
  /*
286
   * (non-Javadoc)
304
   * (non-Javadoc)
287
   *
305
   *
288
   * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
306
   * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
289
   */
307
   */
290

    
   
308

   

    
   
309
  @Override
291
  public boolean execute(String sql, String[] columnNames) throws SQLException {
310
  public boolean execute(String sql, String[] columnNames) throws SQLException {
292
    throw new SQLException("Method not supported");
311
    throw new SQLException("Method not supported");
293
  }
312
  }
294

    
   
313

   
295
  /*
314
  /*
296
   * (non-Javadoc)
315
   * (non-Javadoc)
297
   *
316
   *
298
   * @see java.sql.Statement#executeBatch()
317
   * @see java.sql.Statement#executeBatch()
299
   */
318
   */
300

    
   
319

   

    
   
320
  @Override
301
  public int[] executeBatch() throws SQLException {
321
  public int[] executeBatch() throws SQLException {
302
    throw new SQLException("Method not supported");
322
    throw new SQLException("Method not supported");
303
  }
323
  }
304

    
   
324

   
305
  /*
325
  /*
306
   * (non-Javadoc)
326
   * (non-Javadoc)
307
   *
327
   *
308
   * @see java.sql.Statement#executeQuery(java.lang.String)
328
   * @see java.sql.Statement#executeQuery(java.lang.String)
309
   */
329
   */
310

    
   
330

   

    
   
331
  @Override
311
  public ResultSet executeQuery(String sql) throws SQLException {
332
  public ResultSet executeQuery(String sql) throws SQLException {
312
    if (!execute(sql)) {
333
    if (!execute(sql)) {
313
      throw new SQLException("The query did not generate a result set!");
334
      throw new SQLException("The query did not generate a result set!");
314
    }
335
    }
315
    return resultSet;
336
    return resultSet;
316
  }
337
  }
317

    
   
338

   
318
  /*
339
  /*
319
   * (non-Javadoc)
340
   * (non-Javadoc)
320
   *
341
   *
321
   * @see java.sql.Statement#executeUpdate(java.lang.String)
342
   * @see java.sql.Statement#executeUpdate(java.lang.String)
322
   */
343
   */
323

    
   
344

   

    
   
345
  @Override
324
  public int executeUpdate(String sql) throws SQLException {
346
  public int executeUpdate(String sql) throws SQLException {
325
    execute(sql);
347
    execute(sql);
326
    return 0;
348
    return 0;
327
  }
349
  }
328

    
   
350

   
329
  /*
351
  /*
330
   * (non-Javadoc)
352
   * (non-Javadoc)
331
   *
353
   *
332
   * @see java.sql.Statement#executeUpdate(java.lang.String, int)
354
   * @see java.sql.Statement#executeUpdate(java.lang.String, int)
333
   */
355
   */
334

    
   
356

   

    
   
357
  @Override
335
  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
358
  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
336
    throw new SQLException("Method not supported");
359
    throw new SQLException("Method not supported");
337
  }
360
  }
338

    
   
361

   
339
  /*
362
  /*
340
   * (non-Javadoc)
363
   * (non-Javadoc)
341
   *
364
   *
342
   * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
365
   * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
343
   */
366
   */
344

    
   
367

   

    
   
368
  @Override
345
  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
369
  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
346
    throw new SQLException("Method not supported");
370
    throw new SQLException("Method not supported");
347
  }
371
  }
348

    
   
372

   
349
  /*
373
  /*
350
   * (non-Javadoc)
374
   * (non-Javadoc)
351
   *
375
   *
352
   * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
376
   * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
353
   */
377
   */
354

    
   
378

   

    
   
379
  @Override
355
  public int executeUpdate(String sql, String[] columnNames) throws SQLException {
380
  public int executeUpdate(String sql, String[] columnNames) throws SQLException {
356
    throw new SQLException("Method not supported");
381
    throw new SQLException("Method not supported");
357
  }
382
  }
358

    
   
383

   
359
  /*
384
  /*
360
   * (non-Javadoc)
385
   * (non-Javadoc)
361
   *
386
   *
362
   * @see java.sql.Statement#getConnection()
387
   * @see java.sql.Statement#getConnection()
363
   */
388
   */
364

    
   
389

   

    
   
390
  @Override
365
  public Connection getConnection() throws SQLException {
391
  public Connection getConnection() throws SQLException {
366
    return this.connection;
392
    return this.connection;
367
  }
393
  }
368

    
   
394

   
369
  /*
395
  /*
370
   * (non-Javadoc)
396
   * (non-Javadoc)
371
   *
397
   *
372
   * @see java.sql.Statement#getFetchDirection()
398
   * @see java.sql.Statement#getFetchDirection()
373
   */
399
   */
374

    
   
400

   

    
   
401
  @Override
375
  public int getFetchDirection() throws SQLException {
402
  public int getFetchDirection() throws SQLException {
376
    throw new SQLException("Method not supported");
403
    throw new SQLException("Method not supported");
377
  }
404
  }
378

    
   
405

   
379
  /*
406
  /*
380
   * (non-Javadoc)
407
   * (non-Javadoc)
381
   *
408
   *
382
   * @see java.sql.Statement#getFetchSize()
409
   * @see java.sql.Statement#getFetchSize()
383
   */
410
   */
384

    
   
411

   

    
   
412
  @Override
385
  public int getFetchSize() throws SQLException {
413
  public int getFetchSize() throws SQLException {
386
    return fetchSize;
414
    return fetchSize;
387
  }
415
  }
388

    
   
416

   
389
  /*
417
  /*
390
   * (non-Javadoc)
418
   * (non-Javadoc)
391
   *
419
   *
392
   * @see java.sql.Statement#getGeneratedKeys()
420
   * @see java.sql.Statement#getGeneratedKeys()
393
   */
421
   */
394

    
   
422

   

    
   
423
  @Override
395
  public ResultSet getGeneratedKeys() throws SQLException {
424
  public ResultSet getGeneratedKeys() throws SQLException {
396
    throw new SQLException("Method not supported");
425
    throw new SQLException("Method not supported");
397
  }
426
  }
398

    
   
427

   
399
  /*
428
  /*
400
   * (non-Javadoc)
429
   * (non-Javadoc)
401
   *
430
   *
402
   * @see java.sql.Statement#getMaxFieldSize()
431
   * @see java.sql.Statement#getMaxFieldSize()
403
   */
432
   */
404

    
   
433

   

    
   
434
  @Override
405
  public int getMaxFieldSize() throws SQLException {
435
  public int getMaxFieldSize() throws SQLException {
406
    throw new SQLException("Method not supported");
436
    throw new SQLException("Method not supported");
407
  }
437
  }
408

    
   
438

   
409
  /*
439
  /*
410
   * (non-Javadoc)
440
   * (non-Javadoc)
411
   *
441
   *
412
   * @see java.sql.Statement#getMaxRows()
442
   * @see java.sql.Statement#getMaxRows()
413
   */
443
   */
414

    
   
444

   

    
   
445
  @Override
415
  public int getMaxRows() throws SQLException {
446
  public int getMaxRows() throws SQLException {
416
    return maxRows;
447
    return maxRows;
417
  }
448
  }
418

    
   
449

   
419
  /*
450
  /*
420
   * (non-Javadoc)
451
   * (non-Javadoc)
421
   *
452
   *
422
   * @see java.sql.Statement#getMoreResults()
453
   * @see java.sql.Statement#getMoreResults()
423
   */
454
   */
424

    
   
455

   

    
   
456
  @Override
425
  public boolean getMoreResults() throws SQLException {
457
  public boolean getMoreResults() throws SQLException {
426
    throw new SQLException("Method not supported");
458
    throw new SQLException("Method not supported");
427
  }
459
  }
428

    
   
460

   
429
  /*
461
  /*
430
   * (non-Javadoc)
462
   * (non-Javadoc)
431
   *
463
   *
432
   * @see java.sql.Statement#getMoreResults(int)
464
   * @see java.sql.Statement#getMoreResults(int)
433
   */
465
   */
434

    
   
466

   

    
   
467
  @Override
435
  public boolean getMoreResults(int current) throws SQLException {
468
  public boolean getMoreResults(int current) throws SQLException {
436
    throw new SQLException("Method not supported");
469
    throw new SQLException("Method not supported");
437
  }
470
  }
438

    
   
471

   
439
  /*
472
  /*
440
   * (non-Javadoc)
473
   * (non-Javadoc)
441
   *
474
   *
442
   * @see java.sql.Statement#getQueryTimeout()
475
   * @see java.sql.Statement#getQueryTimeout()
443
   */
476
   */
444

    
   
477

   

    
   
478
  @Override
445
  public int getQueryTimeout() throws SQLException {
479
  public int getQueryTimeout() throws SQLException {
446
    throw new SQLException("Method not supported");
480
    throw new SQLException("Method not supported");
447
  }
481
  }
448

    
   
482

   
449
  /*
483
  /*
450
   * (non-Javadoc)
484
   * (non-Javadoc)
451
   *
485
   *
452
   * @see java.sql.Statement#getResultSet()
486
   * @see java.sql.Statement#getResultSet()
453
   */
487
   */
454

    
   
488

   

    
   
489
  @Override
455
  public ResultSet getResultSet() throws SQLException {
490
  public ResultSet getResultSet() throws SQLException {
456
    return resultSet;
491
    return resultSet;
457
  }
492
  }
458

    
   
493

   
459
  /*
494
  /*
460
   * (non-Javadoc)
495
   * (non-Javadoc)
461
   *
496
   *
462
   * @see java.sql.Statement#getResultSetConcurrency()
497
   * @see java.sql.Statement#getResultSetConcurrency()
463
   */
498
   */
464

    
   
499

   

    
   
500
  @Override
465
  public int getResultSetConcurrency() throws SQLException {
501
  public int getResultSetConcurrency() throws SQLException {
466
    throw new SQLException("Method not supported");
502
    throw new SQLException("Method not supported");
467
  }
503
  }
468

    
   
504

   
469
  /*
505
  /*
470
   * (non-Javadoc)
506
   * (non-Javadoc)
471
   *
507
   *
472
   * @see java.sql.Statement#getResultSetHoldability()
508
   * @see java.sql.Statement#getResultSetHoldability()
473
   */
509
   */
474

    
   
510

   

    
   
511
  @Override
475
  public int getResultSetHoldability() throws SQLException {
512
  public int getResultSetHoldability() throws SQLException {
476
    throw new SQLException("Method not supported");
513
    throw new SQLException("Method not supported");
477
  }
514
  }
478

    
   
515

   
479
  /*
516
  /*
480
   * (non-Javadoc)
517
   * (non-Javadoc)
481
   *
518
   *
482
   * @see java.sql.Statement#getResultSetType()
519
   * @see java.sql.Statement#getResultSetType()
483
   */
520
   */
484

    
   
521

   

    
   
522
  @Override
485
  public int getResultSetType() throws SQLException {
523
  public int getResultSetType() throws SQLException {
486
    throw new SQLException("Method not supported");
524
    throw new SQLException("Method not supported");
487
  }
525
  }
488

    
   
526

   
489
  /*
527
  /*
490
   * (non-Javadoc)
528
   * (non-Javadoc)
491
   *
529
   *
492
   * @see java.sql.Statement#getUpdateCount()
530
   * @see java.sql.Statement#getUpdateCount()
493
   */
531
   */
494

    
   
532

   

    
   
533
  @Override
495
  public int getUpdateCount() throws SQLException {
534
  public int getUpdateCount() throws SQLException {
496
    return 0;
535
    return 0;
497
  }
536
  }
498

    
   
537

   
499
  /*
538
  /*
500
   * (non-Javadoc)
539
   * (non-Javadoc)
501
   *
540
   *
502
   * @see java.sql.Statement#getWarnings()
541
   * @see java.sql.Statement#getWarnings()
503
   */
542
   */
504

    
   
543

   

    
   
544
  @Override
505
  public SQLWarning getWarnings() throws SQLException {
545
  public SQLWarning getWarnings() throws SQLException {
506
    return warningChain;
546
    return warningChain;
507
  }
547
  }
508

    
   
548

   
509
  /*
549
  /*
510
   * (non-Javadoc)
550
   * (non-Javadoc)
511
   *
551
   *
512
   * @see java.sql.Statement#isClosed()
552
   * @see java.sql.Statement#isClosed()
513
   */
553
   */
514

    
   
554

   

    
   
555
  @Override
515
  public boolean isClosed() throws SQLException {
556
  public boolean isClosed() throws SQLException {
516
    return isClosed;
557
    return isClosed;
517
  }
558
  }
518

    
   
559

   
519
  public boolean isCloseOnCompletion() throws SQLException {
560
  public boolean isCloseOnCompletion() throws SQLException {
[+20] [20] 5 lines
[+20] public boolean isClosed() throws SQLException {
525
   * (non-Javadoc)
566
   * (non-Javadoc)
526
   *
567
   *
527
   * @see java.sql.Statement#isPoolable()
568
   * @see java.sql.Statement#isPoolable()
528
   */
569
   */
529

    
   
570

   

    
   
571
  @Override
530
  public boolean isPoolable() throws SQLException {
572
  public boolean isPoolable() throws SQLException {
531
    throw new SQLException("Method not supported");
573
    throw new SQLException("Method not supported");
532
  }
574
  }
533

    
   
575

   
534
  /*
576
  /*
535
   * (non-Javadoc)
577
   * (non-Javadoc)
536
   *
578
   *
537
   * @see java.sql.Statement#setCursorName(java.lang.String)
579
   * @see java.sql.Statement#setCursorName(java.lang.String)
538
   */
580
   */
539

    
   
581

   

    
   
582
  @Override
540
  public void setCursorName(String name) throws SQLException {
583
  public void setCursorName(String name) throws SQLException {
541
    throw new SQLException("Method not supported");
584
    throw new SQLException("Method not supported");
542
  }
585
  }
543

    
   
586

   
544
  /*
587
  /*
545
   * (non-Javadoc)
588
   * (non-Javadoc)
546
   *
589
   *
547
   * @see java.sql.Statement#setEscapeProcessing(boolean)
590
   * @see java.sql.Statement#setEscapeProcessing(boolean)
548
   */
591
   */
549

    
   
592

   

    
   
593
  @Override
550
  public void setEscapeProcessing(boolean enable) throws SQLException {
594
  public void setEscapeProcessing(boolean enable) throws SQLException {
551
    throw new SQLException("Method not supported");
595
    throw new SQLException("Method not supported");
552
  }
596
  }
553

    
   
597

   
554
  /*
598
  /*
555
   * (non-Javadoc)
599
   * (non-Javadoc)
556
   *
600
   *
557
   * @see java.sql.Statement#setFetchDirection(int)
601
   * @see java.sql.Statement#setFetchDirection(int)
558
   */
602
   */
559

    
   
603

   

    
   
604
  @Override
560
  public void setFetchDirection(int direction) throws SQLException {
605
  public void setFetchDirection(int direction) throws SQLException {
561
    throw new SQLException("Method not supported");
606
    throw new SQLException("Method not supported");
562
  }
607
  }
563

    
   
608

   
564
  /*
609
  /*
565
   * (non-Javadoc)
610
   * (non-Javadoc)
566
   *
611
   *
567
   * @see java.sql.Statement#setFetchSize(int)
612
   * @see java.sql.Statement#setFetchSize(int)
568
   */
613
   */
569

    
   
614

   

    
   
615
  @Override
570
  public void setFetchSize(int rows) throws SQLException {
616
  public void setFetchSize(int rows) throws SQLException {
571
    fetchSize = rows;
617
    fetchSize = rows;
572
  }
618
  }
573

    
   
619

   
574
  /*
620
  /*
575
   * (non-Javadoc)
621
   * (non-Javadoc)
576
   *
622
   *
577
   * @see java.sql.Statement#setMaxFieldSize(int)
623
   * @see java.sql.Statement#setMaxFieldSize(int)
578
   */
624
   */
579

    
   
625

   

    
   
626
  @Override
580
  public void setMaxFieldSize(int max) throws SQLException {
627
  public void setMaxFieldSize(int max) throws SQLException {
581
    throw new SQLException("Method not supported");
628
    throw new SQLException("Method not supported");
582
  }
629
  }
583

    
   
630

   
584
  /*
631
  /*
585
   * (non-Javadoc)
632
   * (non-Javadoc)
586
   *
633
   *
587
   * @see java.sql.Statement#setMaxRows(int)
634
   * @see java.sql.Statement#setMaxRows(int)
588
   */
635
   */
589

    
   
636

   

    
   
637
  @Override
590
  public void setMaxRows(int max) throws SQLException {
638
  public void setMaxRows(int max) throws SQLException {
591
    if (max < 0) {
639
    if (max < 0) {
592
      throw new SQLException("max must be >= 0");
640
      throw new SQLException("max must be >= 0");
593
    }
641
    }
594
    maxRows = max;
642
    maxRows = max;
595
  }
643
  }
596

    
   
644

   
597
  /*
645
  /*
598
   * (non-Javadoc)
646
   * (non-Javadoc)
599
   *
647
   *
600
   * @see java.sql.Statement#setPoolable(boolean)
648
   * @see java.sql.Statement#setPoolable(boolean)
601
   */
649
   */
602

    
   
650

   

    
   
651
  @Override
603
  public void setPoolable(boolean poolable) throws SQLException {
652
  public void setPoolable(boolean poolable) throws SQLException {
604
    throw new SQLException("Method not supported");
653
    throw new SQLException("Method not supported");
605
  }
654
  }
606

    
   
655

   
607
  /*
656
  /*
608
   * (non-Javadoc)
657
   * (non-Javadoc)
609
   *
658
   *
610
   * @see java.sql.Statement#setQueryTimeout(int)
659
   * @see java.sql.Statement#setQueryTimeout(int)
611
   */
660
   */
612

    
   
661

   

    
   
662
  @Override
613
  public void setQueryTimeout(int seconds) throws SQLException {
663
  public void setQueryTimeout(int seconds) throws SQLException {
614
    throw new SQLException("Method not supported");
664
    throw new SQLException("Method not supported");
615
  }
665
  }
616

    
   
666

   
617
  /*
667
  /*
618
   * (non-Javadoc)
668
   * (non-Javadoc)
619
   *
669
   *
620
   * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
670
   * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
621
   */
671
   */
622

    
   
672

   

    
   
673
  @Override
623
  public boolean isWrapperFor(Class<?> iface) throws SQLException {
674
  public boolean isWrapperFor(Class<?> iface) throws SQLException {
624
    throw new SQLException("Method not supported");
675
    throw new SQLException("Method not supported");
625
  }
676
  }
626

    
   
677

   
627
  /*
678
  /*
628
   * (non-Javadoc)
679
   * (non-Javadoc)
629
   *
680
   *
630
   * @see java.sql.Wrapper#unwrap(java.lang.Class)
681
   * @see java.sql.Wrapper#unwrap(java.lang.Class)
631
   */
682
   */
632

    
   
683

   

    
   
684
  @Override
633
  public <T> T unwrap(Class<T> iface) throws SQLException {
685
  public <T> T unwrap(Class<T> iface) throws SQLException {
634
    throw new SQLException("Method not supported");
686
    throw new SQLException("Method not supported");
635
  }
687
  }
636

    
   
688

   
637
}
689
}
  1. jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java: Loading...