Re: key group from xx to yy does not contain zz异常

2021-01-28 文章 restart
感谢老师解答,keyBy的执行逻辑看来我理解的太肤浅了。随机数生成逻辑在keyBy前通过map赋值到具体字段,保证后续keyby时稳定,应该就对了。再次感谢老师指点迷津。 -- Sent from: http://apache-flink.147419.n8.nabble.com/

Re: key group from xx to yy does not contain zz异常

2021-01-28 文章 Yun Tang
Hi, 原因是你的key selector引入了随机变量 (也就是下面的方法keyBy),导致其select出来的key不是固定的 public KeySelector keyBy(int parallelism) { return value -> Joiner.on(SeparatorConstant.BAR).join(value.getMetricsId(), ThreadLocalRandom.current().nextInt(parallelism)); } 例如原先的key selector选出的key是