Search in sources :

Example 16 with DependencyNode

use of com.qlangtech.tis.sql.parser.meta.DependencyNode in project tis by qlangtech.

the class DataFlowAppSource method getTargetEntity.

@Override
public EntityName getTargetEntity() {
    try {
        SqlTaskNodeMeta.SqlDataFlowTopology workflowDetail = SqlTaskNodeMeta.getSqlDataFlowTopology(dataflowName);
        Objects.requireNonNull(workflowDetail, "workflowDetail can not be null");
        EntityName targetEntity = null;
        if (workflowDetail.isSingleTableModel()) {
            DependencyNode dumpNode = workflowDetail.getDumpNodes().get(0);
            targetEntity = dumpNode.parseEntityName();
        } else {
            SqlTaskNodeMeta finalN = workflowDetail.getFinalNode();
            targetEntity = EntityName.parse(finalN.getExportName());
        }
        return targetEntity;
    } catch (Exception e) {
        throw new RuntimeException(dataflowName, e);
    }
}
Also used : EntityName(com.qlangtech.tis.sql.parser.tuple.creator.EntityName) DependencyNode(com.qlangtech.tis.sql.parser.meta.DependencyNode) SqlTaskNodeMeta(com.qlangtech.tis.sql.parser.SqlTaskNodeMeta)

Aggregations

DependencyNode (com.qlangtech.tis.sql.parser.meta.DependencyNode)16 SqlTaskNodeMeta (com.qlangtech.tis.sql.parser.SqlTaskNodeMeta)5 EntityName (com.qlangtech.tis.sql.parser.tuple.creator.EntityName)5 TabExtraMeta (com.qlangtech.tis.sql.parser.meta.TabExtraMeta)3 Lists (com.google.common.collect.Lists)2 IDumpTable (com.qlangtech.tis.fullbuild.indexbuild.IDumpTable)2 DumpPhaseStatus (com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus)2 DataflowTask (com.qlangtech.tis.fullbuild.taskflow.DataflowTask)2 File (java.io.File)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Collectors (java.util.stream.Collectors)2 JSONField (com.alibaba.fastjson.annotation.JSONField)1 Joiner (com.google.common.base.Joiner)1 TIS (com.qlangtech.tis.TIS)1 FullbuildPhase (com.qlangtech.tis.assemble.FullbuildPhase)1 HiveDBUtils (com.qlangtech.tis.dump.hive.HiveDBUtils)1 HiveRemoveHistoryDataTask (com.qlangtech.tis.dump.hive.HiveRemoveHistoryDataTask)1 ExecuteResult (com.qlangtech.tis.exec.ExecuteResult)1