丁云鹏 10 ماه پیش
والد
کامیت
9bdaddccf8

+ 13 - 4
recommend-feature-produce/src/main/java/com/tzld/piaoquan/recommend/feature/produce/FeatureDiff.java

@@ -10,9 +10,7 @@ import org.apache.spark.api.java.JavaRDD;
 import org.apache.spark.api.java.JavaSparkContext;
 import org.apache.spark.api.java.function.Function;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author dyp
@@ -23,8 +21,16 @@ public class FeatureDiff {
     private static ODPSService odpsService = new ODPSService();
 
     private static Map<String, String> tableToCol;
+    private static Set<String> abCodes;
 
     static {
+        abCodes = new HashSet<>();
+        abCodes.add("ab0");
+        abCodes.add("ab1");
+        abCodes.add("ab2");
+        abCodes.add("ab3");
+
+
         tableToCol = new HashMap<>();
         tableToCol.put("alg_vid_feature_all_exp", "b1_feature");
         tableToCol.put("alg_vid_feature_all_share", "b2_feature");
@@ -55,7 +61,6 @@ public class FeatureDiff {
 //        tableToCol.put("alg_mid_feature_sharecf", "c8_feature");
 //        tableToCol.put("alg_mid_feature_returncf", "c9_feature");
 
-
     }
 
     public static void main(String[] args) {
@@ -88,6 +93,10 @@ public class FeatureDiff {
                             return false;
                         }
 
+                        if (!abCodes.contains(map.get("abcode"))) {
+                            return false;
+                        }
+
                         Map<String, Map<String, String>> metaFeatureMap = JSONUtils.fromJson(map.get("metafeaturemap"),
                                 new TypeToken<Map<String, Map<String, String>>>() {
                                 }, Collections.emptyMap());

+ 2 - 2
recommend-feature-produce/src/main/java/com/tzld/piaoquan/recommend/feature/produce/Test.java

@@ -83,8 +83,8 @@ public class Test {
         odps.setEndpoint(odpsUrl);
         odps.setDefaultProject("loghubods");
 
-        String sql = "select * from loghubods.alg_recsys_sample_all_new where dt=20240616 and hh=18 and flowpool = '' \n" +
-                "AND abcode='ab0';";
+        String sql = "select * from loghubods.alg_recsys_sample_all_new where dt=20240616 and hh=18 and flowpool = ''" +
+                " AND abcode='ab0' limit 100;";
 
         List<Record> records = null;
         try {