Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiples Push Down Method instances #24

Open
osmarleandro opened this issue Feb 11, 2021 · 0 comments
Open

Multiples Push Down Method instances #24

osmarleandro opened this issue Feb 11, 2021 · 0 comments

Comments

@osmarleandro
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant