利用TaskContext.getPartitionId()获取分区Id。 rdd.partitionBy(partitioner) .foreachPartition(iter->{ int id=TaskContext.getPartitionId(); StringBuilder sb = new StringBuilder(); sb.append("Pid=").append(id); while(iter.hasNext()){ ...
xiaohan.hashnode.dev1 min readNo responses yet.