wangbo commented on a change in pull request #3927:
URL: https://github.com/apache/incubator-doris/pull/3927#discussion_r443924281



##########
File path: fe/src/main/java/org/apache/doris/load/loadv2/etl/SparkEtlJob.java
##########
@@ -0,0 +1,241 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.load.loadv2.etl;
+
+import org.apache.doris.load.loadv2.dpp.GlobalDictBuilder;
+import org.apache.doris.load.loadv2.dpp.SparkDpp;
+import org.apache.doris.load.loadv2.etl.EtlJobConfig.EtlColumn;
+import org.apache.doris.load.loadv2.etl.EtlJobConfig.EtlColumnMapping;
+import org.apache.doris.load.loadv2.etl.EtlJobConfig.EtlFileGroup;
+import org.apache.doris.load.loadv2.etl.EtlJobConfig.EtlIndex;
+import org.apache.doris.load.loadv2.etl.EtlJobConfig.EtlTable;
+
+import org.apache.commons.collections.map.MultiValueMap;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.Dataset;
+import org.apache.spark.sql.SparkSession;
+import org.apache.spark.sql.functions;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * SparkEtlJob is responsible for global dict building, data partition, data 
sort and data aggregation.
+ * 1. init job config
+ * 2. check if job has bitmap_dict function columns
+ * 3. build global dict if step 2 is true
+ * 4. dpp (data partition, data sort and data aggregation)
+ */
+public class SparkEtlJob {
+    private static final Logger LOG = LogManager.getLogger(SparkEtlJob.class);
+
+    private static final String BITMAP_DICT_FUNC = "bitmap_dict";
+    private static final String TO_BITMAP_FUNC = "to_bitmap";
+
+    private String jobConfigFilePath;
+    private EtlJobConfig etlJobConfig;
+    private Set<Long> hiveSourceTables;
+    private Map<Long, Set<String>> tableToBitmapDictColumns;
+    private SparkSession spark;
+
+    private SparkEtlJob(String jobConfigFilePath) {
+        this.jobConfigFilePath = jobConfigFilePath;
+        this.etlJobConfig = null;
+        this.hiveSourceTables = Sets.newHashSet();
+        this.tableToBitmapDictColumns = Maps.newHashMap();
+    }
+
+    private void initSparkEnvironment() {
+        spark = SparkSession.builder().enableHiveSupport().getOrCreate();
+    }
+
+    private void initHiveConfigs(Map<String, String> hiveProperties) {

Review comment:
       ```suggestion
       private void iniSparkConfigs(Map<String, String> sparkProperties) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to