Browse Source

rov&nor feature

jch 4 months ago
parent
commit
3cf849c596

+ 1 - 1
src/main/scala/com/aliyun/odps/spark/examples/makedata_recsys_r_rate/makedata_recsys_61_bucket_20241209.scala

@@ -55,7 +55,7 @@ object makedata_recsys_61_bucket_20241209 {
         doubles.put(r._1, jsons.getDoubleValue(r._1))
       })
       doubles
-    }).sample(false, sampleRate).repartition(20)
+    }).sample(false, sampleRate).repartition(32).persist()
 
     val result = new ArrayBuffer[String]()
 

+ 1 - 1
src/main/scala/com/aliyun/odps/spark/examples/makedata_recsys_r_rate/makedata_recsys_61_originData_20241209.scala

@@ -329,7 +329,7 @@ object makedata_recsys_61_originData_20241209 {
       if (hdfsPath.nonEmpty && hdfsPath.startsWith("/dw/recommend/model/")) {
         println("删除路径并开始数据写入:" + hdfsPath)
         MyHdfsUtils.delete_hdfs_path(hdfsPath)
-        odpsData.coalesce(repartition).saveAsTextFile(hdfsPath, classOf[GzipCodec])
+        odpsData.repartition(repartition).saveAsTextFile(hdfsPath, classOf[GzipCodec])
       } else {
         println("路径不合法,无法写入:" + hdfsPath)
       }