-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Summary
In the source code present in osmarleandro/incubator-gobblin@8353b60 commit, I applied a single Push Down Method to convertRecord() method in AvroToJsonStringConverterBase class, and RefDiff yields multiple instances.
Can these multiples instances be a single instance, since the same method can not be pushed down more than one time in the same revision?
Code example
Diff fragment between the commit osmarleandro/incubator-gobblin@8353b60 and their parent.
@@ -81,16 +79,5 @@ public abstract class AvroToJsonStringConverterBase<T> extends Converter<Schema,
return this.schema.toString();
}
- @Override
- public Iterable<T> convertRecord(String outputSchema, GenericRecord inputRecord, WorkUnitState workUnit)
- throws DataConversionException {
- try {
- byte[] utf8Bytes = this.serializer.get().serialize(inputRecord);
- return Collections.singleton(processUtf8Bytes(utf8Bytes));
- } catch (IOException ioe) {
- throw new DataConversionException(ioe);
- }
- }
-
@@ -24,4 +30,14 @@ public class AvroToJsonStringConverter extends AvroToJsonStringConverterBase<Str
protected String processUtf8Bytes(byte[] utf8Bytes) {
return new String(utf8Bytes, StandardCharsets.UTF_8);
}
+
+@Override
+public Iterable<String> convertRecord(String outputSchema, GenericRecord inputRecord, WorkUnitState workUnit) throws DataConversionException {
+ try {
+ byte[] utf8Bytes = this.serializer.get().serialize(inputRecord);
+ return Collections.singleton(processUtf8Bytes(utf8Bytes));
+ } catch (IOException ioe) {
+ throw new DataConversionException(ioe);
+ }
+ }
Environment details
RefDiff 2.0
Steps to reproduce
- Run RefDiff and give as input the commit osmarleandro/incubator-gobblin@8353b60.
Actual results
PUSH_DOWN {Method convertRecord(String, GenericRecord, WorkUnitState) at gobblin-modules/gobblin-avro-json/src/main/java/org/apache/gobblin/converter/avro/AvroToJsonStringConverterBase.java:84} {Method convertRecord(String, GenericRecord, WorkUnitState) at gobblin-modules/gobblin-avro-json/src/main/java/org/apache/gobblin/converter/avro/AvroToJsonBytesConverter.java:32})
PUSH_DOWN {Method convertRecord(String, GenericRecord, WorkUnitState) at gobblin-modules/gobblin-avro-json/src/main/java/org/apache/gobblin/converter/avro/AvroToJsonStringConverterBase.java:84} {Method convertRecord(String, GenericRecord, WorkUnitState) at gobblin-modules/gobblin-avro-json/src/main/java/org/apache/gobblin/converter/avro/AvroToJsonStringConverter.java:34})
Expected results
A single instance of the Push Down Method refactoring applied to convertRecord() method in AvroToJsonStringConverterBase class.
Metadata
Metadata
Assignees
Labels
No labels