0
votes

I am confused by the section at https://ci.apache.org/projects/flink/flink-docs-release-1.11/learn-flink/etl.html#keyby

At first it says

rides
    .flatMap(new NYCEnrichment())
    .keyBy(value -> value.startCell)

is not good becase

This style of key selection has the drawback that the compiler is unable to infer the type of the field being used for keying, and so Flink will pass around the key values as Tuples, which can be awkward.

But later in that section it says

rides
    .flatMap(new NYCEnrichment())
    .keyBy(enrichedRide -> enrichedRide.startCell)

is fine, aren't the two identical?

1

1 Answers

0
votes

You’re right, they are identical, and they are not problematic.

Some forms of keyBy were recently deprecated, and someone went through and updated all uses of the deprecated forms of keyBy in the docs. In general this was a very good thing, but in this one particular spot, doing so left a confusing paragraph behind -- because the bad example is no longer shown.