xueyiming 1 týždeň pred
rodič
commit
67ce7fa485

+ 4 - 5
src/main/scala/com/aliyun/odps/spark/examples/makedata_ad/v20240718/makedata_ad_33_bucketDataFromOriginToHive_20250522.scala

@@ -123,16 +123,15 @@ object makedata_ad_33_bucketDataFromOriginToHive_20250522 {
               val mid = record.getString("mid")
               val pqtid = record.getString("pqtid")
               val apptype = record.getString("apptype")
-              val abcode = record.getString("abcode")
 
               featureMap.put("apptype", apptype)
               featureMap.put("ts", ts)
               featureMap.put("mid", mid)
               featureMap.put("pqtid", pqtid)
-
+              val extend: JSONObject = if (record.isNull("extend")) new JSONObject() else
+                JSON.parseObject(record.getString("extend"))
               val mateFeature: JSONObject = if (record.isNull("metafeature")) new JSONObject() else
                 JSON.parseObject(record.getString("metafeature"))
-
               val reqFeature: JSONObject = if (!mateFeature.containsKey("reqFeature")) new JSONObject() else
                 mateFeature.getJSONObject("reqFeature")
               val sceneFeature: JSONObject = if (!mateFeature.containsKey("sceneFeature")) new JSONObject() else
@@ -206,8 +205,8 @@ object makedata_ad_33_bucketDataFromOriginToHive_20250522 {
 
               featureMap.put("apptype_" + apptype, idDefaultValue);
 
-              if (abcode.nonEmpty) {
-                featureMap.put("abcode_" + abcode, idDefaultValue)
+              if (extend.containsKey("abcode") && extend.getString("abcode").nonEmpty) {
+                featureMap.put("abcode_" + extend.getString("abcode"), idDefaultValue)
               }
 
               if (reqFeature.containsKey("region") && reqFeature.getString("region").nonEmpty) {