use of com.dtstack.taier.develop.service.develop.IBatchSelectSqlService in project Taier by DTStack.
the class BatchSelectSqlService method beforeGetResult.
/**
* sql查询前置处理
*
* @param jobId
* @param taskId
* @param tenantId
* @param type
* @param sqlId
* @return
*/
private ExecuteSelectSqlData beforeGetResult(String jobId, Long taskId, Long tenantId, Integer type, String sqlId) {
BatchSelectSql batchHiveSelectSql = developHiveSelectSqlDao.getByJobId(StringUtils.isNotEmpty(sqlId) ? sqlId : jobId, tenantId, null);
Preconditions.checkNotNull(batchHiveSelectSql, "不存在该临时查询");
if (StringUtils.isNotEmpty(sqlId)) {
batchHiveSelectSql.setFatherJobId(jobId);
batchHiveSelectSql.setJobId(sqlId);
}
IBatchSelectSqlService selectSqlService = multiEngineServiceFactory.getBatchSelectSqlService(batchHiveSelectSql.getTaskType());
Preconditions.checkNotNull(selectSqlService, String.format("不支持此任务类型 %d", batchHiveSelectSql.getTaskType()));
BatchTask batchTask = batchTaskService.getOneWithError(taskId);
;
Integer taskType = null;
if (Objects.nonNull(batchTask)) {
taskType = batchTask.getTaskType();
}
if (Objects.isNull(taskType)) {
throw new DtCenterDefException("任务类型为空");
}
return new ExecuteSelectSqlData(batchHiveSelectSql, batchTask, taskType, selectSqlService);
}
Aggregations