|
@@ -17,19 +17,21 @@ import java.io.IOException;
|
|
|
public class EnterpriseGroupJob {
|
|
|
|
|
|
|
|
|
- private static final String vertexTableName;
|
|
|
- private static final String edgeTableName;
|
|
|
- private static final String outputTable;
|
|
|
+ private static final String defaultInputVertexTab;
|
|
|
+ private static final String defaultEdgeInputTab;
|
|
|
+ private static final String defaultOutputParentTab;
|
|
|
+ private static final String defaultOutputMainTab = "calc_enterprise_group_main_tab";
|
|
|
+ private static final String defaultOutputRelationTab = "calc_enterprise_group_relation_tab";
|
|
|
|
|
|
static {
|
|
|
if (BaseUtils.isWindows()) {
|
|
|
- vertexTableName = "tmp_xjk_test_enterprise_group_input_vertex";
|
|
|
- edgeTableName = "tmp_xjk_test_enterprise_group_input_edge";
|
|
|
- outputTable = "tmp_xjk_test_enterprise_group_out";
|
|
|
+ defaultInputVertexTab = "tmp_xjk_test_enterprise_group_input_vertex";
|
|
|
+ defaultEdgeInputTab = "tmp_xjk_test_enterprise_group_input_edge";
|
|
|
+ defaultOutputParentTab = "tmp_xjk_test_enterprise_group_out";
|
|
|
} else {
|
|
|
- vertexTableName = "tmp_xjk_enterprise_group_input_vertex";
|
|
|
- edgeTableName = "tmp_xjk_enterprise_group_input_edge";
|
|
|
- outputTable = "tmp_xjk_enterprise_group_out";
|
|
|
+ defaultInputVertexTab = "calc_enterprise_group_input_vertex";
|
|
|
+ defaultEdgeInputTab = "calc_enterprise_group_input_edge";
|
|
|
+ defaultOutputParentTab = "calc_enterprise_group_out_parent_tab";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -41,6 +43,13 @@ public class EnterpriseGroupJob {
|
|
|
String numWorkers = parameterTool.getOrDefault("numWorkers", "70");
|
|
|
String workerCPU = parameterTool.getOrDefault("workerCPU", "2");
|
|
|
String workerMem = parameterTool.getOrDefault("workerMem", "8192");
|
|
|
+
|
|
|
+ String inputVertexTab = parameterTool.getOrDefault("inputVertexTab", defaultInputVertexTab);
|
|
|
+ String edgeInputTab = parameterTool.getOrDefault("edgeInputTab", defaultEdgeInputTab);
|
|
|
+ String outputParentTab = parameterTool.getOrDefault("outputParentTab", defaultOutputParentTab);
|
|
|
+ String outputMainTab = parameterTool.getOrDefault("outputMainTab", defaultOutputMainTab);
|
|
|
+ String outputRelationTab = parameterTool.getOrDefault("outputRelationTab", defaultOutputRelationTab);
|
|
|
+
|
|
|
String outPart = parameterTool.getOrDefault("outPart", nowDate);
|
|
|
String debugVertexId = parameterTool.getOrDefault("debugVertexId", null);
|
|
|
System.out.println("input args: " + String.join(" ", args));
|
|
@@ -57,7 +66,7 @@ public class EnterpriseGroupJob {
|
|
|
}
|
|
|
|
|
|
if (parameterTool.has("enableDebug")) {
|
|
|
- String debugIndex = parameterTool.getOrDefault("debugIndex", null);
|
|
|
+ String debugIndex = parameterTool.getOrDefault("debugIndex", null);
|
|
|
job.set("winhc.debug", "true");
|
|
|
job.set("winhc.debug.index", debugIndex);
|
|
|
job.set("winhc.debug.debugVertexId", debugVertexId);
|
|
@@ -77,16 +86,32 @@ public class EnterpriseGroupJob {
|
|
|
|
|
|
job.addInput(TableInfo.builder()
|
|
|
.projectName("winhc_ng")
|
|
|
- .tableName(vertexTableName)
|
|
|
+ .label("vertex")
|
|
|
+ .tableName(inputVertexTab)
|
|
|
.build());
|
|
|
job.addInput(TableInfo.builder()
|
|
|
.projectName("winhc_ng")
|
|
|
- .tableName(edgeTableName)
|
|
|
+ .tableName(edgeInputTab)
|
|
|
+ .label("edge")
|
|
|
+ .build());
|
|
|
+
|
|
|
+ job.addOutput(TableInfo.builder()
|
|
|
+ .projectName("winhc_ng")
|
|
|
+ .tableName(outputParentTab)
|
|
|
+ .label("parent")
|
|
|
+ .partSpec("ds='" + outPart + "'")
|
|
|
+ .build());
|
|
|
+ job.addOutput(TableInfo.builder()
|
|
|
+ .projectName("winhc_ng")
|
|
|
+ .tableName(outputMainTab)
|
|
|
+ .partSpec("ds='" + outPart + "'")
|
|
|
+ .label("main")
|
|
|
.build());
|
|
|
job.addOutput(TableInfo.builder()
|
|
|
.projectName("winhc_ng")
|
|
|
- .tableName(outputTable)
|
|
|
+ .tableName(outputRelationTab)
|
|
|
.partSpec("ds='" + outPart + "'")
|
|
|
+ .label("relation")
|
|
|
.build());
|
|
|
|
|
|
|