Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/5126
Just a comment on the use of `TypeHint`:
In the `DataSet` and `DataStream` API, we typically pass `TypeInformation`
when offering an explicit way to describe the type. The reason is that
`TypeInformation` is the core class to describe types, and when you pick up the
type from somewhere to pass it on, you get a `TypeInformation`.
The `TypeHint` class is used as a trick to create a `TypeInformation` by
capturing the parameters through creating an anonymous subclass. In some way,
one could always use `new TypeHint<Tuple2<Long, String>>(){}.getTypeInfo()`,
but for convenience, some methods accept directly a `TypeHint`, mainly the
`returns(...)` method.
If you take `TypeHint` directly as a parameter, it becomes hard to pass the
type if you for example obtain it from another `DataSet` via the `getType()`
method.
---