xiaohanxiaohan.hashnode.dev·Jul 21, 2024Spark RDD如何获取TaskId利用TaskContext.getPartitionId()获取分区Id。 rdd.partitionBy(partitioner) .foreachPartition(iter->{ int id=TaskContext.getPartitionId(); StringBuilder sb = new StringBuilder(); sb.append("Pid=").append(id); while(iter.hasNext()){ ...sparkAdd a thoughtful commentNo comments yetBe the first to start the conversation.