bgeng777 commented on code in PR #29630:
URL: https://github.com/apache/flink/pull/29630#discussion_r4388646579
##########
flink-python/src/main/java/org/apache/flink/streaming/api/utils/PythonTypeUtils.java:
##########
@@ -1101,11 +1113,17 @@ public boolean equals(Object o) {
public static final class TupleDataConverter extends DataConverter<Tuple,
Object[]> {
private final DataConverter[] fieldDataConverters;
+ private final boolean reuse;
private final Tuple reuseTuple;
private final Object[] reuseExternalTuple;
TupleDataConverter(DataConverter[] dataConverters) {
Review Comment:
nit: this constructor no longer has any callers
##########
flink-python/src/main/java/org/apache/flink/streaming/api/utils/PythonTypeUtils.java:
##########
@@ -1374,27 +1406,29 @@ public static <IN, OUT> DataConverter<IN, OUT>
typeInfoDataConverter(
if (typeInformation instanceof RowTypeInfo) {
DataConverter[] fieldDataConverters =
Arrays.stream(((RowTypeInfo)
typeInformation).getFieldTypes())
-
.map(TypeInfoToDataConverter::typeInfoDataConverter)
+ .map(fieldType ->
typeInfoDataConverter(fieldType, reuse))
.toArray(DataConverter[]::new);
- return (DataConverter<IN, OUT>) new
RowDataConverter(fieldDataConverters);
+ return (DataConverter<IN, OUT>)
+ new RowDataConverter(fieldDataConverters, reuse);
}
if (typeInformation instanceof TupleTypeInfo) {
Object[] fieldDataConverters =
Review Comment:
nit: we can make this line more cleare by declaring fieldDataConverters as
DataConverter[] in the Tuple branch to avoid casting back from Object[].
##########
flink-python/src/main/java/org/apache/flink/streaming/api/utils/PythonTypeUtils.java:
##########
Review Comment:
nit: we can remove this line, toExternal() now assigns it before use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]