diff --git a/metadata-integration/java/datahub-protobuf/README.md b/metadata-integration/java/datahub-protobuf/README.md index e6b9465abd..e7e4bd23a0 100644 --- a/metadata-integration/java/datahub-protobuf/README.md +++ b/metadata-integration/java/datahub-protobuf/README.md @@ -444,7 +444,7 @@ The following is a consolidated example for the possible field level term option ##### OWNER -One or more owners can be specified and can be any combination of `corpUser` and `corpGroup` entities. The default entity type is `corpGroup`. By default, the ownership type is set to `producer`, see the second example for setting the ownership type. +One or more owners can be specified and can be any combination of `corpUser` and `corpGroup` entities. The default entity type is `corpGroup`. By default, the ownership type is set to `technical_owner`, see the second example for setting the ownership type. The following example assigns the ownership to a group of `myGroup` and a user called `myName`. diff --git a/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/visitors/dataset/OwnershipVisitor.java b/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/visitors/dataset/OwnershipVisitor.java index 0f0ad2ea69..7bb4d9860f 100644 --- a/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/visitors/dataset/OwnershipVisitor.java +++ b/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/visitors/dataset/OwnershipVisitor.java @@ -37,14 +37,14 @@ public class OwnershipVisitor implements ProtobufModelVisitor { try { ownershipType = OwnershipType.valueOf(entry.getKey().getName().toUpperCase()); } catch (IllegalArgumentException e) { - ownershipType = OwnershipType.PRODUCER; + ownershipType = OwnershipType.TECHNICAL_OWNER; } String[] id = entry.getValue().toLowerCase().split(":", 2); return new Owner() .setType(ownershipType) .setSource(new OwnershipSource().setType(OwnershipSourceType.MANUAL)) - .setOwner(new Urn(id.length > 1 ? id[0] : "corpgroup", id[id.length - 1])); + .setOwner(new Urn(id.length > 1 ? id[0].replaceFirst("corpgroup", "corpGroup") : "corpGroup", id[id.length - 1])); } catch (URISyntaxException e) { System.err.println(e.getMessage()); return null; diff --git a/metadata-integration/java/datahub-protobuf/src/test/java/datahub/protobuf/visitors/dataset/OwnershipVisitorTest.java b/metadata-integration/java/datahub-protobuf/src/test/java/datahub/protobuf/visitors/dataset/OwnershipVisitorTest.java index baefd365c8..cf2649e86d 100644 --- a/metadata-integration/java/datahub-protobuf/src/test/java/datahub/protobuf/visitors/dataset/OwnershipVisitorTest.java +++ b/metadata-integration/java/datahub-protobuf/src/test/java/datahub/protobuf/visitors/dataset/OwnershipVisitorTest.java @@ -27,17 +27,17 @@ public class OwnershipVisitorTest { OwnershipVisitor test = new OwnershipVisitor(); assertEquals(Set.of(new Owner() - .setType(OwnershipType.PRODUCER) + .setType(OwnershipType.TECHNICAL_OWNER) .setSource(new OwnershipSource().setType(OwnershipSourceType.MANUAL)) - .setOwner(Urn.createFromTuple("corpgroup", "teamb")), + .setOwner(Urn.createFromTuple("corpGroup", "teamb")), new Owner() - .setType(OwnershipType.PRODUCER) + .setType(OwnershipType.TECHNICAL_OWNER) .setSource(new OwnershipSource().setType(OwnershipSourceType.MANUAL)) .setOwner(Urn.createFromTuple("corpuser", "datahub")), new Owner() .setType(OwnershipType.TECHNICAL_OWNER) .setSource(new OwnershipSource().setType(OwnershipSourceType.MANUAL)) - .setOwner(Urn.createFromTuple("corpgroup", "technicalowner")) + .setOwner(Urn.createFromTuple("corpGroup", "technicalowner")) ), graph.accept(getVisitContextBuilder("extended_protobuf.MessageA"), List.of(test)).collect(Collectors.toSet())); }