HiveJdbcConnector hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(props); statement = hiveJdbcConnector.getConnection().createStatement();
HiveJdbcConnector hiveJdbcConnector = closer.register(HiveJdbcConnector.newConnectorWithProps(props)); for (String query : queries) { String hiveOutput = "hiveConversionValidationOutput_" + UUID.randomUUID().toString();
@Override public DataWriter<QueryBasedHiveConversionEntity> build() throws IOException { try { return new HiveQueryExecutionWriter(HiveJdbcConnector.newConnectorWithProps(this.destination.getProperties().getProperties()), this.destination.getProperties()); } catch (SQLException e) { throw new RuntimeException(e); } } }
@Override public void compact() throws IOException { checkSchemaCompatibility(); Closer closer = Closer.create(); try { this.conn = closer.register(HiveJdbcConnector.newConnectorWithProps(CompactionRunner.properties)); setHiveParameters(); createTables(); HiveTable mergedDelta = mergeDeltas(); HiveManagedTable notUpdated = getNotUpdatedRecords(this.snapshot, mergedDelta); unionNotUpdatedRecordsAndDeltas(notUpdated, mergedDelta); } catch (SQLException e) { LOG.error("SQLException during compaction: " + e.getMessage()); throw new RuntimeException(e); } catch (IOException e) { LOG.error("IOException during compaction: " + e.getMessage()); throw new RuntimeException(e); } catch (RuntimeException e) { LOG.error("Runtime Exception during compaction: " + e.getMessage()); throw e; } finally { try { deleteTmpFiles(); } finally { closer.close(); } } }
public HiveTask(TaskContext taskContext) { super(taskContext); this.taskContext = taskContext; this.workUnitState = taskContext.getTaskState(); this.workUnit = new HiveWorkUnit(this.workUnitState.getWorkunit()); this.eventSubmitter = new EventSubmitter.Builder(this.metricContext, "gobblin.HiveTask") .build(); this.hiveExecutionQueries = Lists.newArrayList(); this.publishEntity = new QueryBasedHivePublishEntity(); try { this.hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(this.workUnitState.getProperties()); } catch (SQLException se) { throw new RuntimeException("Error in creating JDBC Connector", se); } this.addFiles = this.workUnitState.getPropAsList(ADD_FILES, ""); this.addJars = this.workUnitState.getPropAsList(ADD_JARS, ""); this.setupQueries = Splitter.on(";").trimResults().omitEmptyStrings().splitToList(this.workUnitState.getProp(SETUP_QUERIES, "")); }
this.hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(state.getProperties()); } catch (SQLException e) { throw new RuntimeException(e);
HiveJdbcConnector hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(props); statement = hiveJdbcConnector.getConnection().createStatement();
HiveJdbcConnector hiveJdbcConnector = closer.register(HiveJdbcConnector.newConnectorWithProps(props)); for (String query : queries) { String hiveOutput = "hiveConversionValidationOutput_" + UUID.randomUUID().toString();
@Override public DataWriter<QueryBasedHiveConversionEntity> build() throws IOException { try { return new HiveQueryExecutionWriter(HiveJdbcConnector.newConnectorWithProps(this.destination.getProperties().getProperties()), this.destination.getProperties()); } catch (SQLException e) { throw new RuntimeException(e); } } }
@Override public void compact() throws IOException { checkSchemaCompatibility(); Closer closer = Closer.create(); try { this.conn = closer.register(HiveJdbcConnector.newConnectorWithProps(CompactionRunner.properties)); setHiveParameters(); createTables(); HiveTable mergedDelta = mergeDeltas(); HiveManagedTable notUpdated = getNotUpdatedRecords(this.snapshot, mergedDelta); unionNotUpdatedRecordsAndDeltas(notUpdated, mergedDelta); } catch (SQLException e) { LOG.error("SQLException during compaction: " + e.getMessage()); throw new RuntimeException(e); } catch (IOException e) { LOG.error("IOException during compaction: " + e.getMessage()); throw new RuntimeException(e); } catch (RuntimeException e) { LOG.error("Runtime Exception during compaction: " + e.getMessage()); throw e; } finally { try { deleteTmpFiles(); } finally { closer.close(); } } }
public HiveTask(TaskContext taskContext) { super(taskContext); this.taskContext = taskContext; this.workUnitState = taskContext.getTaskState(); this.workUnit = new HiveWorkUnit(this.workUnitState.getWorkunit()); this.eventSubmitter = new EventSubmitter.Builder(this.metricContext, "gobblin.HiveTask") .build(); this.hiveExecutionQueries = Lists.newArrayList(); this.publishEntity = new QueryBasedHivePublishEntity(); try { this.hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(this.workUnitState.getProperties()); } catch (SQLException se) { throw new RuntimeException("Error in creating JDBC Connector", se); } this.addFiles = this.workUnitState.getPropAsList(ADD_FILES, ""); this.addJars = this.workUnitState.getPropAsList(ADD_JARS, ""); this.setupQueries = Splitter.on(";").trimResults().omitEmptyStrings().splitToList(this.workUnitState.getProp(SETUP_QUERIES, "")); }
this.hiveJdbcConnector = HiveJdbcConnector.newConnectorWithProps(state.getProperties()); } catch (SQLException e) { throw new RuntimeException(e);