Search in sources :

Example 1 with EngineCatalogueType

use of com.dtstack.taier.common.enums.EngineCatalogueType in project Taier by DTStack.

the class BatchCatalogueService method replaceSystemFunction.

/**
 * 根据目录类型查询对应的函数根目录
 * @param catalogueId
 * @param catalogueType
 * @param childCatalogues
 */
private void replaceSystemFunction(Long catalogueId, String catalogueType, List<BatchCatalogue> childCatalogues) {
    if (CatalogueType.SPARKSQL_FUNCTION.getType().equals(catalogueType)) {
        BatchCatalogue one = developCatalogueDao.getOne(catalogueId);
        EngineCatalogueType systemEngineType = EngineCatalogueType.getByeName(one == null ? null : one.getNodeName());
        // 需要将系统函数替换对应 引擎的函数模板
        BatchCatalogue systemFuncCatalogue = developCatalogueDao.getSystemFunctionCatalogueOne(systemEngineType.getType());
        if (systemFuncCatalogue == null) {
            return;
        }
        for (BatchCatalogue childCatalogue : childCatalogues) {
            if ("系统函数".equals(childCatalogue.getNodeName())) {
                childCatalogue.setNodePid(systemFuncCatalogue.getNodePid());
                childCatalogue.setId(systemFuncCatalogue.getId());
            }
        }
    }
}
Also used : EngineCatalogueType(com.dtstack.taier.common.enums.EngineCatalogueType) BatchCatalogue(com.dtstack.taier.dao.domain.BatchCatalogue)

Aggregations

EngineCatalogueType (com.dtstack.taier.common.enums.EngineCatalogueType)1 BatchCatalogue (com.dtstack.taier.dao.domain.BatchCatalogue)1