Thijs van de Poll
03/14/2023, 9:52 AMsap1ens
03/14/2023, 4:19 PMIf I am not mistaken, Flink CDC source operators require a parallelism of 1 to ensure that the sequence of update events is correct. Is it correct that for all the sources you used parallelism of 1 then, and for the sink a high parallelism to maximise resources for the join?In the talk I didn’t use Flink CDC. We used Debezium with Kafka Connect and Flink was reading from Kafka topics. You’d only use parallelism of 1 if you want to keep global ordering. Usually you’re fine with correct ordering within a primary key. In this case you can call a
keyBy right after the source to get the correct semantics (as long as Kafka topics use the same key).sap1ens
03/14/2023, 4:20 PMsap1ens
03/14/2023, 4:21 PMAny work in progress on backfilling the state?Nothing to report 🙂
Thijs van de Poll
03/14/2023, 6:06 PMflink stop --savepointPath ... and got an error that checkpointing failed. However, it seemed that creating a manual savepoint by flink savepoint ... ... actually creates a savepoint without checkpoints failing. After that I was able to cancel the job and start from the savepoint again.
Any idea why this is the case?sap1ens
03/14/2023, 6:07 PMReme Ajayi
03/15/2023, 9:25 PMkeyby would work because both streams don't have the same type. For reference:
DataStream <TypeA> StreamA = ...
DataStream <TypeB> StreamB = ...
DataStream<TypeC> JoinedStream = StreamA.union(StreamB)
.keyBy(new KeySelector<A or B ?>, String>() {
@Override
public String getKey(<A or B ?> value) throws Exception {
return value.getSomeKey;
}
})
.process(new JoinFunction());
JoinFunction would have to return a different type TypeCsap1ens
03/15/2023, 9:27 PMgetKey method that extracts the correct key from TypeA or TypeB, depending on what’s defined. You can use that for keyByReme Ajayi
03/15/2023, 9:29 PMReme Ajayi
03/15/2023, 10:00 PMTypeC contains all the fields in TypeA and TypeB as well as the common key. The union operators throws an exception still because TypeA and TypeB are not of the same type. Please let me know if I've understood you correctly. I don't really understand this part - "And for that type you’d implement a getKey method that extracts the correct key from TypeA or TypeB"
DataStream <TypeA> StreamA = ...
DataStream <TypeB> StreamB = ...
DataStream<TypeC> JoinedStream = StreamA.union(StreamB)
.keyBy(new TypeC>, String>() {
@Override
public String getKey(TypeC value) throws Exception {
return value.getSomeKey;
}
})
.process(new JoinFunction());sap1ens
03/15/2023, 10:08 PMcase class Wrapper(
typeA: Option[TypeA] = None,
typeB: Option[TypeB] = None
) {
def getKey: String = {
// check if typeA is defined, then return typeA.key, otherwise return typeB.key
}
}sap1ens
03/15/2023, 10:08 PMsap1ens
03/15/2023, 10:08 PM