From ba2d4527a8dc72a85b6ab8b9f553fbc9ba12665f Mon Sep 17 00:00:00 2001 From: vburlachenko Date: Fri, 16 Feb 2024 16:24:09 +0200 Subject: [PATCH] update ingest according to opendatadiscovery-specification PR - #76 --- gradle/libs.versions.toml | 2 +- .../oddplatform/dto/DataEntityClassDto.java | 5 +++-- .../opendatadiscovery/oddplatform/dto/DataEntityTypeDto.java | 3 ++- .../ReactiveDataEntityRelationshipRepositoryImpl.java | 4 ++-- odd-platform-specification/components.yaml | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 86252f684..ff4667e8f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ spring-starter-cloud = '3.1.0' spring-starter-bootstrap = '3.1.0' reactor-extra = '3.5.1' micrometer-registry-prometheus = '1.9.0' -ingestion-contract-server = '0.1.38' +ingestion-contract-server = '0.1.39' oddrn-generator-java = '0.1.21' odd-integration-manifests = '0.0.6' apache-collections = '4.4' diff --git a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityClassDto.java b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityClassDto.java index 1d7d6e594..c67b4cc9c 100644 --- a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityClassDto.java +++ b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityClassDto.java @@ -19,9 +19,11 @@ import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.DASHBOARD; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.DATABASE_SERVICE; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.DOMAIN; +import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ENTITY_RELATIONSHIP; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.FEATURE_GROUP; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.FILE; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.GRAPH_NODE; +import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.GRAPH_RELATIONSHIP; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.JOB; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.JOB_RUN; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.KAFKA_SERVICE; @@ -32,7 +34,6 @@ import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_ARTIFACT; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_INSTANCE; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.ML_MODEL_TRAINING; -import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.RELATIONSHIP; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.TABLE; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.VECTOR_STORE; import static org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto.VIEW; @@ -47,7 +48,7 @@ public enum DataEntityClassDto { DATA_CONSUMER(6, Set.of(ML_MODEL_ARTIFACT, DASHBOARD)), DATA_INPUT(7, API_CALL), DATA_ENTITY_GROUP(8, Set.of(ML_EXPERIMENT, DAG, DATABASE_SERVICE, API_SERVICE, KAFKA_SERVICE, DOMAIN)), - DATA_RELATIONSHIP(9, RELATIONSHIP); + DATA_RELATIONSHIP(9, Set.of(ENTITY_RELATIONSHIP, GRAPH_RELATIONSHIP)); private static final Map MAP = Arrays.stream(DataEntityClassDto.values()) .collect(Collectors.toMap(DataEntityClassDto::getId, identity())); diff --git a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityTypeDto.java b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityTypeDto.java index c1a2d552c..de31fe52d 100644 --- a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityTypeDto.java +++ b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/dto/DataEntityTypeDto.java @@ -34,7 +34,8 @@ public enum DataEntityTypeDto { DOMAIN(22), VECTOR_STORE(23), LOOKUP_TABLE(24), - RELATIONSHIP(25); + ENTITY_RELATIONSHIP(25), + GRAPH_RELATIONSHIP(26); private static final Map MAP = Arrays .stream(DataEntityTypeDto.values()) diff --git a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/repository/reactive/ReactiveDataEntityRelationshipRepositoryImpl.java b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/repository/reactive/ReactiveDataEntityRelationshipRepositoryImpl.java index f8d8e40ad..54c68fe3d 100644 --- a/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/repository/reactive/ReactiveDataEntityRelationshipRepositoryImpl.java +++ b/odd-platform-api/src/main/java/org/opendatadiscovery/oddplatform/repository/reactive/ReactiveDataEntityRelationshipRepositoryImpl.java @@ -16,7 +16,6 @@ import org.jooq.Table; import org.jooq.impl.DSL; import org.opendatadiscovery.oddplatform.api.contract.model.RelationshipsType; -import org.opendatadiscovery.oddplatform.dto.DataEntityTypeDto; import org.opendatadiscovery.oddplatform.dto.RelationshipDto; import org.opendatadiscovery.oddplatform.model.tables.pojos.DataEntityPojo; import org.opendatadiscovery.oddplatform.model.tables.pojos.RelationshipsPojo; @@ -29,6 +28,7 @@ import org.springframework.stereotype.Repository; import reactor.core.publisher.Mono; +import static org.opendatadiscovery.oddplatform.dto.DataEntityClassDto.DATA_RELATIONSHIP; import static org.opendatadiscovery.oddplatform.model.Tables.DATA_ENTITY; import static org.opendatadiscovery.oddplatform.model.Tables.RELATIONSHIPS; @@ -57,7 +57,7 @@ public Mono> getRelationships(final Integer page, final In conditionList.add(DATA_ENTITY.EXTERNAL_NAME.containsIgnoreCase(inputQuery)); } - conditionList.add(DATA_ENTITY.TYPE_ID.eq(DataEntityTypeDto.RELATIONSHIP.getId())); + conditionList.add(DATA_ENTITY.ENTITY_CLASS_IDS.eq(new Integer[] {DATA_RELATIONSHIP.getId()})); final Select homogeneousQuery = DSL.selectFrom(DATA_ENTITY) .where(conditionList); diff --git a/odd-platform-specification/components.yaml b/odd-platform-specification/components.yaml index 4a7d77927..ce9d10d35 100644 --- a/odd-platform-specification/components.yaml +++ b/odd-platform-specification/components.yaml @@ -757,7 +757,8 @@ components: - DOMAIN - VECTOR_STORE - LOOKUP_TABLE - - RELATIONSHIP + - ENTITY_RELATIONSHIP + - GRAPH_RELATIONSHIP required: - id - name