You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/11/12 01:59:26 UTC

[GitHub] [incubator-gobblin] sv2000 opened a new pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

sv2000 opened a new pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153


   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [x] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1316
   
   
   ### Description
   - [x] Here are some details about my PR, including screenshots (if applicable):
   When a namespace override is applied to an input schema, the new schema does not currently contain the field and schema level properties of the original schema. 
   
   
   ### Tests
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Unit test in AvroUtilsTest.
   
   ### Commits
   - [x] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] codecov-io edited a comment on pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#issuecomment-730569254


   # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=h1) Report
   > Merging [#3153](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=desc) (8d6600f) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/64c8ad93c239b76968ecd644a55f5d0b1c4fc400?el=desc) (64c8ad9) will **decrease** coverage by `0.03%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/graphs/tree.svg?width=650&height=150&src=pr&token=4MgURJ0bGc)](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3153      +/-   ##
   ============================================
   - Coverage     46.01%   45.97%   -0.04%     
   - Complexity     9592     9595       +3     
   ============================================
     Files          1989     1993       +4     
     Lines         75901    75996      +95     
     Branches       8452     8462      +10     
   ============================================
   + Hits          34923    34941      +18     
   - Misses        37710    37790      +80     
   + Partials       3268     3265       -3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...c/main/java/org/apache/gobblin/util/AvroUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvQXZyb1V0aWxzLmphdmE=) | `55.80% <100.00%> (-1.25%)` | `80.00 <0.00> (-1.00)` | |
   | [...apache/gobblin/converter/parquet/ParquetGroup.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1tb2R1bGVzL2dvYmJsaW4tcGFycXVldC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9jb252ZXJ0ZXIvcGFycXVldC9QYXJxdWV0R3JvdXAuamF2YQ==) | `45.05% <0.00%> (-2.62%)` | `16.00% <0.00%> (ø%)` | |
   | [...lin/restli/throttling/ZookeeperLeaderElection.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi10aHJvdHRsaW5nLXNlcnZpY2UvZ29iYmxpbi10aHJvdHRsaW5nLXNlcnZpY2Utc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3Jlc3RsaS90aHJvdHRsaW5nL1pvb2tlZXBlckxlYWRlckVsZWN0aW9uLmphdmE=) | `70.00% <0.00%> (-2.23%)` | `13.00% <0.00%> (ø%)` | |
   | [.../java/org/apache/gobblin/runtime/api/FlowSpec.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvYXBpL0Zsb3dTcGVjLmphdmE=) | `43.01% <0.00%> (-0.49%)` | `13.00% <0.00%> (ø%)` | |
   | [...obblin/service/FlowConfigResourceLocalHandler.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi1mbG93LWNvbmZpZy1zZXJ2aWNlL2dvYmJsaW4tZmxvdy1jb25maWctc2VydmljZS1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vc2VydmljZS9GbG93Q29uZmlnUmVzb3VyY2VMb2NhbEhhbmRsZXIuamF2YQ==) | `18.39% <0.00%> (-0.44%)` | `2.00% <0.00%> (ø%)` | |
   | [...pache/gobblin/configuration/ConfigurationKeys.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vY29uZmlndXJhdGlvbi9Db25maWd1cmF0aW9uS2V5cy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
   | [.../apache/gobblin/service/FlowConfigsV2Resource.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi1mbG93LWNvbmZpZy1zZXJ2aWNlL2dvYmJsaW4tZmxvdy1jb25maWctc2VydmljZS1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vc2VydmljZS9GbG93Q29uZmlnc1YyUmVzb3VyY2UuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
   | [...che/gobblin/service/NoopGroupOwnershipService.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi1mbG93LWNvbmZpZy1zZXJ2aWNlL2dvYmJsaW4tZmxvdy1jb25maWctc2VydmljZS1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vc2VydmljZS9Ob29wR3JvdXBPd25lcnNoaXBTZXJ2aWNlLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (?%)` | |
   | [...he/gobblin/service/LocalGroupOwnershipService.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi1mbG93LWNvbmZpZy1zZXJ2aWNlL2dvYmJsaW4tZmxvdy1jb25maWctc2VydmljZS1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vc2VydmljZS9Mb2NhbEdyb3VwT3duZXJzaGlwU2VydmljZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (?%)` | |
   | ... and [8 more](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=footer). Last update [64c8ad9...8d6600f](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] codecov-io commented on pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#issuecomment-730569254


   # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=h1) Report
   > Merging [#3153](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=desc) (8d6600f) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/64c8ad93c239b76968ecd644a55f5d0b1c4fc400?el=desc) (64c8ad9) will **decrease** coverage by `36.75%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/graphs/tree.svg?width=650&height=150&src=pr&token=4MgURJ0bGc)](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #3153       +/-   ##
   ============================================
   - Coverage     46.01%   9.25%   -36.76%     
   + Complexity     9592    1727     -7865     
   ============================================
     Files          1989    1993        +4     
     Lines         75901   75996       +95     
     Branches       8452    8462       +10     
   ============================================
   - Hits          34923    7031    -27892     
   - Misses        37710   68283    +30573     
   + Partials       3268     682     -2586     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...c/main/java/org/apache/gobblin/util/AvroUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvQXZyb1V0aWxzLmphdmE=) | `0.00% <0.00%> (-57.05%)` | `0.00 <0.00> (-81.00)` | |
   | [...c/main/java/org/apache/gobblin/util/FileUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvRmlsZVV0aWxzLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-4.00%)` | |
   | [...n/java/org/apache/gobblin/fork/CopyableSchema.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2ZvcmsvQ29weWFibGVTY2hlbWEuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
   | [...java/org/apache/gobblin/stream/ControlMessage.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vc3RyZWFtL0NvbnRyb2xNZXNzYWdlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...va/org/apache/gobblin/dataset/DatasetResolver.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YXNldC9EYXRhc2V0UmVzb2x2ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
   | [...va/org/apache/gobblin/converter/EmptyIterable.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbnZlcnRlci9FbXB0eUl0ZXJhYmxlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...org/apache/gobblin/ack/BasicAckableForTesting.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vYWNrL0Jhc2ljQWNrYWJsZUZvclRlc3RpbmcuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
   | [...n/java/org/apache/gobblin/salesforce/SfConfig.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1zYWxlc2ZvcmNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NhbGVzZm9yY2UvU2ZDb25maWcuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [.../org/apache/gobblin/yarn/HelixMessageSubTypes.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi15YXJuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3lhcm4vSGVsaXhNZXNzYWdlU3ViVHlwZXMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...va/org/apache/gobblin/cluster/SingleHelixTask.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvU2luZ2xlSGVsaXhUYXNrLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-5.00%)` | |
   | ... and [1055 more](https://codecov.io/gh/apache/incubator-gobblin/pull/3153/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=footer). Last update [64c8ad9...8d6600f](https://codecov.io/gh/apache/incubator-gobblin/pull/3153?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] htran1 commented on a change in pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
htran1 commented on a change in pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#discussion_r521770998



##########
File path: gobblin-utility/src/test/java/org/apache/gobblin/util/AvroUtilsTest.java
##########
@@ -51,9 +51,11 @@
 import org.codehaus.jackson.JsonNode;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.node.ArrayNode;
+import org.codehaus.jackson.node.JsonNodeFactory;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import com.beust.jcommander.internal.Lists;

Review comment:
       Should this be the guava one instead?

##########
File path: gobblin-utility/src/test/java/org/apache/gobblin/util/AvroUtilsTest.java
##########
@@ -235,8 +237,21 @@ public void testSwitchNamespace() {
     String originalNamespace = "originalNamespace";
     String originalName = "originalName";
     String newNamespace = "newNamespace";
-    Schema schema = SchemaBuilder.builder(originalNamespace).record(originalName).fields().
-        requiredDouble("double").optionalFloat("float").endRecord();
+    //Schema schema = SchemaBuilder.builder(originalNamespace).record(originalName).fields().

Review comment:
       Remove these lines?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] shirshanka commented on a change in pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
shirshanka commented on a change in pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#discussion_r526531121



##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java
##########
@@ -781,11 +781,19 @@ public static Schema switchNamespace(Schema schema, Map<String, String> namespac
           for (Schema.Field oldField : schema.getFields()) {
             Field newField = new Field(oldField.name(), switchNamespace(oldField.schema(), namespaceOverride), oldField.doc(),
                 oldField.defaultValue(), oldField.order());
+            // Copy field level properties
+            for (Map.Entry<String, JsonNode> prop : oldField.getJsonProps().entrySet()) {

Review comment:
       Use the already defined copyFieldProperties method? 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] shirshanka commented on a change in pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
shirshanka commented on a change in pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153#discussion_r526531766



##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java
##########
@@ -781,11 +781,19 @@ public static Schema switchNamespace(Schema schema, Map<String, String> namespac
           for (Schema.Field oldField : schema.getFields()) {
             Field newField = new Field(oldField.name(), switchNamespace(oldField.schema(), namespaceOverride), oldField.doc(),
                 oldField.defaultValue(), oldField.order());
+            // Copy field level properties
+            for (Map.Entry<String, JsonNode> prop : oldField.getJsonProps().entrySet()) {
+              newField.addProp(prop.getKey(), prop.getValue());
+            }
             newFields.add(newField);
           }
         }
         newSchema = Schema.createRecord(schema.getName(), schema.getDoc(), newNamespace,
             schema.isError());
+        // Copy schema level properties

Review comment:
       Use the already defined copyProperties method?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-gobblin] asfgit closed pull request #3153: GOBBLIN-1316: Copy field and schema level properties when switching namespace in a schema

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3153:
URL: https://github.com/apache/incubator-gobblin/pull/3153


   


----------------------------------------------------------------
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:
users@infra.apache.org