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 2022/02/03 20:49:50 UTC

[GitHub] [gobblin] Will-Lo opened a new pull request #3460: [GOBBLIN-1603] Throws error if configured when encountering an IO exception while co…

Will-Lo opened a new pull request #3460:
URL: https://github.com/apache/gobblin/pull/3460


   …llecting copy entities
   
   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
   - [ ] 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-1603
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   HiveCopyEntityHelper will fail silently if it encounters IOExceptions or invalid tables to be copied. We need to propagate these errors so that it will be much easier to debug tables that are failing during this collection step.
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   
   ### Commits
   - [ ] 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.

To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [gobblin] ZihanLi58 merged pull request #3460: [GOBBLIN-1603] Throws error if configured when encountering an IO exception while co…

Posted by GitBox <gi...@apache.org>.
ZihanLi58 merged pull request #3460:
URL: https://github.com/apache/gobblin/pull/3460


   


-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [gobblin] codecov-commenter commented on pull request #3460: [GOBBLIN-1603] Throws error if configured when encountering an IO exception while co…

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #3460:
URL: https://github.com/apache/gobblin/pull/3460#issuecomment-1031839431


   # [Codecov](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3460](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c9115c) into [master](https://codecov.io/gh/apache/gobblin/commit/52ca72c19347872f4caf40fd92fb06d1d337a04f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (52ca72c) will **increase** coverage by `0.00%`.
   > The diff coverage is `72.72%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/gobblin/pull/3460/graphs/tree.svg?width=650&height=150&src=pr&token=4MgURJ0bGc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #3460   +/-   ##
   =========================================
     Coverage     46.63%   46.63%           
   - Complexity    10348    10354    +6     
   =========================================
     Files          2075     2075           
     Lines         81012    81019    +7     
     Branches       9039     9042    +3     
   =========================================
   + Hits          37777    37784    +7     
   - Misses        39755    39760    +5     
   + Partials       3480     3475    -5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...gobblin/data/management/copy/hive/HiveDataset.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9IaXZlRGF0YXNldC5qYXZh) | `84.03% <72.72%> (+7.24%)` | :arrow_up: |
   | [.../modules/scheduler/GobblinServiceJobScheduler.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NlcnZpY2UvbW9kdWxlcy9zY2hlZHVsZXIvR29iYmxpblNlcnZpY2VKb2JTY2hlZHVsZXIuamF2YQ==) | `63.68% <0.00%> (-5.48%)` | :arrow_down: |
   | [...lin/restli/throttling/ZookeeperLeaderElection.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1yZXN0bGkvZ29iYmxpbi10aHJvdHRsaW5nLXNlcnZpY2UvZ29iYmxpbi10aHJvdHRsaW5nLXNlcnZpY2Utc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3Jlc3RsaS90aHJvdHRsaW5nL1pvb2tlZXBlckxlYWRlckVsZWN0aW9uLmphdmE=) | `70.00% <0.00%> (-2.23%)` | :arrow_down: |
   | [.../apache/gobblin/runtime/api/JobExecutionState.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvYXBpL0pvYkV4ZWN1dGlvblN0YXRlLmphdmE=) | `79.43% <0.00%> (-0.94%)` | :arrow_down: |
   | [...main/java/org/apache/gobblin/util/HadoopUtils.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvSGFkb29wVXRpbHMuamF2YQ==) | `29.93% <0.00%> (-0.66%)` | :arrow_down: |
   | [.../org/apache/gobblin/cluster/GobblinTaskRunner.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvR29iYmxpblRhc2tSdW5uZXIuamF2YQ==) | `63.78% <0.00%> (+0.32%)` | :arrow_up: |
   | [...ata/management/copy/hive/HiveCopyEntityHelper.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvaGl2ZS9IaXZlQ29weUVudGl0eUhlbHBlci5qYXZh) | `61.97% <0.00%> (+0.84%)` | :arrow_up: |
   | [...gobblin/service/modules/core/GitConfigMonitor.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NlcnZpY2UvbW9kdWxlcy9jb3JlL0dpdENvbmZpZ01vbml0b3IuamF2YQ==) | `83.05% <0.00%> (+1.69%)` | :arrow_up: |
   | [...obblin/data/management/copy/CopyConfiguration.java](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1kYXRhLW1hbmFnZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vZGF0YS9tYW5hZ2VtZW50L2NvcHkvQ29weUNvbmZpZ3VyYXRpb24uamF2YQ==) | `86.95% <0.00%> (+6.52%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/gobblin/pull/3460/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [52ca72c...9c9115c](https://codecov.io/gh/apache/gobblin/pull/3460?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [gobblin] umustafi commented on a change in pull request #3460: [GOBBLIN-1603] Throws error if configured when encountering an IO exception while co…

Posted by GitBox <gi...@apache.org>.
umustafi commented on a change in pull request #3460:
URL: https://github.com/apache/gobblin/pull/3460#discussion_r801028000



##########
File path: gobblin-data-management/src/test/java/org/apache/gobblin/data/management/copy/hive/HiveDatasetTest.java
##########
@@ -156,15 +165,67 @@ public void testResolveConfig() throws IOException {
     HiveDatasetFinder.DbAndTable logicalDbAndTable = new HiveDatasetFinder.DbAndTable("logicalDb", "logicalTable");
     Config resolvedConfig = HiveDataset.resolveConfig(config, realDbAndTable, logicalDbAndTable);
 
-    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_DB_TOKEN),
-        "resPrefix_realDb_resPostfix", "Real DB not resolved correctly");
-    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_TABLE_TOKEN),
-        "resPrefix_realTable_resPostfix", "Real Table not resolved correctly");
+    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_DB_TOKEN), "resPrefix_realDb_resPostfix",
+        "Real DB not resolved correctly");
+    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_TABLE_TOKEN), "resPrefix_realTable_resPostfix",
+        "Real Table not resolved correctly");
 
     Assert.assertEquals(resolvedConfig.getString(HiveDatasetVersionCleaner.REPLACEMENT_HIVE_DB_NAME_KEY),
         "resPrefix_logicalDb_resPostfix", "Logical DB not resolved correctly");
     Assert.assertEquals(resolvedConfig.getString(HiveDatasetVersionCleaner.REPLACEMENT_HIVE_TABLE_NAME_KEY),
         "resPrefix_logicalTable_resPostfix", "Logical Table not resolved correctly");
-    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_STRIP_SUFFIX),"testRoot");
+    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_STRIP_SUFFIX), "testRoot");
+  }
+
+  @Test(expectedExceptions = RuntimeException.class)
+  public void testThrowsErrorIfCopyEntityHelperFails() throws Exception {
+    Properties copyProperties = new Properties();
+    Properties hiveProperties = new Properties();
+    copyProperties.put(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, "/target");
+    // Invoke an IOException by passing in a class that does not exist to HiveCopyEntityHelper constructor
+    hiveProperties.put(HiveCopyEntityHelper.COPY_PARTITION_FILTER_GENERATOR, "missingClass");
+    Table table = new Table(Table.getEmptyTable("testDB", "testTable"));
+    HiveMetastoreClientPool pool = HiveMetastoreClientPool.get(new Properties(), Optional.absent());
+
+    HiveDataset passingDataset = new HiveDataset(new LocalFileSystem(), pool, table, hiveProperties);
+    // Even though IOException is thrown HiveDataset should silence it due to not having the configuration flag
+    try {
+      CopyConfiguration copyConfigWithoutAbortKey = CopyConfiguration.builder(new LocalFileSystem(), copyProperties).build();
+      passingDataset.getFileSetIterator(FileSystem.getLocal(new Configuration()), copyConfigWithoutAbortKey);
+    } catch (Exception e) {
+      Assert.fail("IOException should log and fail silently since it is not configured");
+    }
+
+    // Exception should propagate to a RuntimeException since flag is enabled
+    copyProperties.put(CopyConfiguration.ABORT_ON_SINGLE_DATASET_FAILURE, "true");
+    HiveDataset failingDataset = new HiveDataset(new LocalFileSystem(), pool, table, hiveProperties);
+    CopyConfiguration copyConfiguration = CopyConfiguration.builder(new LocalFileSystem(), copyProperties).build();
+    failingDataset.getFileSetIterator(FileSystem.getLocal(new Configuration()), copyConfiguration);
+  }
+
+  @Test(expectedExceptions = RuntimeException.class)
+  public void testThrowsErrorIfTableNotCopyable() throws Exception {
+    Properties copyProperties = new Properties();
+    Properties hiveProperties = new Properties();
+    copyProperties.put(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, "/target");
+    Table table = new Table(Table.getEmptyTable("testDB", "testTable"));
+    // Virtual view tables are not copyable
+    table.setTableType(TableType.VIRTUAL_VIEW);
+    HiveMetastoreClientPool pool = HiveMetastoreClientPool.get(new Properties(), Optional.absent());
+
+    HiveDataset passingDataset = new HiveDataset(new LocalFileSystem(), pool, table, hiveProperties);
+    // Since flag is not enabled the dataset should log an error and continue

Review comment:
       very clearly defined tests, nice job!




-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org