hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveQueryExecutor.java
private void execute(String query) throws StageException {
    LOG.debug("Executing SQL: {}", query);
    Timer.Context t = updateTimer.time();
    try(Statement statement = hiveConfigBean.getHiveConnection().createStatement()) {
      statement.execute(query);
    } catch (Exception e) {
      LOG.error("Exception while processing query: {}", query, e);
      throw new HiveStageCheckedException(Errors.HIVE_20, query, e.getMessage());
    } finally {
      long time = t.stop();
      LOG.debug("Query '{}' took {} nanoseconds", query, time);
      updateMeter.mark();
    }
  }
private void execute(String query) throws StageException {
    LOG.debug("Executing SQL: {}", query);
    Timer.Context t = updateTimer.time();
    try(Statement statement = hiveConfigBean.getHiveConnection().createStatement()) {
      statement.execute(query);
    } catch (Exception e) {
      LOG.error("Exception while processing query: {}", query, e);
      throw new HiveStageCheckedException(Errors.HIVE_20, query, e.getMessage());
    } finally {
      long time = t.stop();
      LOG.debug("Query '{}' took {} nanoseconds", query, time);
      updateMeter.mark();
    }
  }
private void execute ( String query ) throws StageException { LOG . debug ( "Executing SQL: {}" , query ) ; Timer . Context t = updateTimer . time ( ) ; try ( Statement statement = hiveConfigBean . getHiveConnection ( ) . createStatement ( ) ) { statement . execute ( query ) ; } catch ( Exception e ) { LOG . error ( "Exception while processing query: {}" , query , e ) ; throw new HiveStageCheckedException ( Errors . HIVE_20 , query , e . getMessage ( ) ) ; } finally { long time = t . stop ( ) ; LOG . debug ( "Query '{}' took {} nanoseconds" , query , time ) ; updateMeter . mark ( ) ; } }
Execute given query.

With all required side effects such as catching exceptions, updating metrics, ...
@param query Query to execute
@throws StageException
Execute given query .