Parcourir la source

修改广告特征获取来源

xueyiming il y a 1 jour
Parent
commit
ea5ca70ab7

+ 16 - 12
src/main/scala/com/aliyun/odps/spark/examples/makedata_ad/v20240718/makedata_ad_33_bucketDataFromOriginToHive_20250522.scala

@@ -187,18 +187,6 @@ object makedata_ad_33_bucketDataFromOriginToHive_20250522 {
               if (b1.containsKey("targeting_conversion") && b1.getString("targeting_conversion").nonEmpty) {
                 featureMap.put("targeting_conversion_" + b1.getString("targeting_conversion"), idDefaultValue)
               }
-              if (b1.containsKey("cid") && b1.getString("cid").nonEmpty) {
-                featureMap.put("cid", b1.getBigInteger("cid"))
-              }
-              if (b1.containsKey("adid") && b1.getString("adid").nonEmpty) {
-                featureMap.put("adid", b1.getBigInteger("adid"))
-              }
-              if (b1.containsKey("adverid") && b1.getString("adverid").nonEmpty) {
-                featureMap.put("adverid", b1.getBigInteger("adverid"))
-              }
-              if (b1.containsKey("profession") && b1.getString("profession").nonEmpty) {
-                featureMap.put("profession", b1.getString("profession"))
-              }
               if (b1.containsKey("creative_type") && b1.getString("creative_type").nonEmpty) {
                 featureMap.put("creative_type", b1.getString("creative_type"))
               }
@@ -233,6 +221,22 @@ object makedata_ad_33_bucketDataFromOriginToHive_20250522 {
                 featureMap.put("abcode_" + extend.getString("abcode"), idDefaultValue)
               }
 
+              if (reqFeature.containsKey("cid") && reqFeature.getString("cid").nonEmpty) {
+                featureMap.put("cid", reqFeature.getString("cid"))
+              }
+
+              if (reqFeature.containsKey("adid") && reqFeature.getString("adid").nonEmpty) {
+                featureMap.put("adid", reqFeature.getString("adid"))
+              }
+
+              if (reqFeature.containsKey("adverid") && reqFeature.getString("adverid").nonEmpty) {
+                featureMap.put("adverid", reqFeature.getString("adverid"))
+              }
+
+              if (reqFeature.containsKey("profession") && reqFeature.getString("profession").nonEmpty) {
+                featureMap.put("profession", reqFeature.getString("profession"))
+              }
+
               if (reqFeature.containsKey("region") && reqFeature.getString("region").nonEmpty) {
                 featureMap.put("region", reqFeature.getString("region"))
               }