[
https://issues.apache.org/jira/browse/GOBBLIN-1602?focusedWorklogId=721341&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-721341
]
ASF GitHub Bot logged work on GOBBLIN-1602:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 05/Feb/22 02:16
Start Date: 05/Feb/22 02:16
Worklog Time Spent: 10m
Work Description: umustafi commented on a change in pull request #3459:
URL: https://github.com/apache/gobblin/pull/3459#discussion_r799926493
##########
File path:
gobblin-data-management/src/test/java/org/apache/gobblin/data/management/copy/hive/UnpartitionedTableFileSetTest.java
##########
@@ -44,11 +48,47 @@ public void testHiveTableLocationNotMatchException() throws
Exception {
Mockito.when(helper.getDataset()).thenReturn(hiveDataset);
Mockito.when(helper.getExistingTargetTable()).thenReturn(Optional.of(existingTargetTable));
Mockito.when(helper.getTargetTable()).thenReturn(table);
+ // Mock filesystem resolver
+ FileSystem mockFS = Mockito.mock(FileSystem.class);
+ Mockito.when(helper.getTargetFs()).thenReturn(mockFS);
+
Mockito.when(mockFS.resolvePath(Mockito.any())).then(returnsFirstArg());
+
+
Mockito.when(helper.getExistingEntityPolicy()).thenReturn(HiveCopyEntityHelper.ExistingEntityPolicy.ABORT);
+ MetricContext metricContext =
MetricContext.builder("testUnpartitionedTableFileSet").build();
+ EventSubmitter eventSubmitter = new
EventSubmitter.Builder(metricContext,"loc.nomatch.exp").build();
+ Mockito.when(helper.getEventSubmitter()).thenReturn(eventSubmitter);
+ UnpartitionedTableFileSet upts = new
UnpartitionedTableFileSet("testLocationMatch",hiveDataset,helper);
+ List<CopyEntity> copyEntities =
(List<CopyEntity>)upts.generateCopyEntities();
+ }
+
+ @Test
+ public void testHiveTableLocationMatchDifferentPathsResolved() throws
Exception {
+ Path testPath = new Path("/testPath/db/table");
+ Path existingTablePath = new Path("/existing/testPath/db/table");
Review comment:
Is it worth adding a test case comparing logical and physical paths to
be explicit about what we're testing the difference between? If existing is
logical and user specified is physical, then we don't want it to use the
physical path right?
Also why are the partitioned and snapshot cases different? For partitioned
cases if paths differ we throw and error and abort, but for snapshot we can
check the policy and overwrite location as needed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 721341)
Time Spent: 50m (was: 40m)
> Handle hive table mismatch when paths are equivalent in the underlying FS
> -------------------------------------------------------------------------
>
> Key: GOBBLIN-1602
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1602
> Project: Apache Gobblin
> Issue Type: Task
> Components: gobblin-core
> Reporter: William Lo
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> In scenarios where the paths are equivalent in the underlying FS, hive copy
> should not treat these paths separately if the user provided URI does not
> match the hive registered URI
--
This message was sent by Atlassian Jira
(v8.20.1#820001)