lukecwik commented on a change in pull request #13166:
URL: https://github.com/apache/beam/pull/13166#discussion_r510266391



##########
File path: 
sdks/java/io/hadoop-format/src/main/java/org/apache/beam/sdk/io/hadoop/format/HadoopFormatIO.java
##########
@@ -437,6 +445,12 @@
           .build();
     }
 
+    /** Transforms the keys read from the source using the given key 
translation function. */
+    public Read<K, V> withKeyTranslation(SimpleFunction<?, K> function, 
Coder<K> coder) {

Review comment:
       Since we don't need the type information anymore, we should use 
SerializableFunction instead of SimpleFunction.

##########
File path: 
sdks/java/io/hadoop-format/src/main/java/org/apache/beam/sdk/io/hadoop/format/HadoopFormatIO.java
##########
@@ -437,6 +445,12 @@
           .build();
     }
 
+    /** Transforms the keys read from the source using the given key 
translation function. */
+    public Read<K, V> withKeyTranslation(SimpleFunction<?, K> function, 
Coder<K> coder) {

Review comment:
       You need to clear the keyCoder/valueCoder in the non coder based 
variants otherwise we won't honor the typedescriptor when the user changes the 
translation function




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to