Skip to content

Commit

Permalink
fix(graphql): add missing entities to EntityTypeMapper and EntityType…
Browse files Browse the repository at this point in the history
…UrnMapper (#10366)
  • Loading branch information
Masterchen09 authored Aug 9, 2024
1 parent 78336c9 commit aa07e2a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,49 @@ public class EntityTypeMapper {

static final Map<EntityType, String> ENTITY_TYPE_TO_NAME =
ImmutableMap.<EntityType, String>builder()
.put(EntityType.DOMAIN, Constants.DOMAIN_ENTITY_NAME)
.put(EntityType.DATASET, Constants.DATASET_ENTITY_NAME)
.put(EntityType.ROLE, Constants.ROLE_ENTITY_NAME)
.put(EntityType.CORP_USER, Constants.CORP_USER_ENTITY_NAME)
.put(EntityType.CORP_GROUP, Constants.CORP_GROUP_ENTITY_NAME)
.put(EntityType.DATA_PLATFORM, Constants.DATA_PLATFORM_ENTITY_NAME)
.put(EntityType.ER_MODEL_RELATIONSHIP, Constants.ER_MODEL_RELATIONSHIP_ENTITY_NAME)
.put(EntityType.DASHBOARD, Constants.DASHBOARD_ENTITY_NAME)
.put(EntityType.NOTEBOOK, Constants.NOTEBOOK_ENTITY_NAME)
.put(EntityType.CHART, Constants.CHART_ENTITY_NAME)
.put(EntityType.TAG, Constants.TAG_ENTITY_NAME)
.put(EntityType.DATA_FLOW, Constants.DATA_FLOW_ENTITY_NAME)
.put(EntityType.DATA_JOB, Constants.DATA_JOB_ENTITY_NAME)
.put(EntityType.DATA_PROCESS_INSTANCE, Constants.DATA_PROCESS_INSTANCE_ENTITY_NAME)
.put(EntityType.TAG, Constants.TAG_ENTITY_NAME)
.put(EntityType.GLOSSARY_TERM, Constants.GLOSSARY_TERM_ENTITY_NAME)
.put(EntityType.GLOSSARY_NODE, Constants.GLOSSARY_NODE_ENTITY_NAME)
.put(EntityType.CONTAINER, Constants.CONTAINER_ENTITY_NAME)
.put(EntityType.MLMODEL, Constants.ML_MODEL_ENTITY_NAME)
.put(EntityType.MLMODEL_GROUP, Constants.ML_MODEL_GROUP_ENTITY_NAME)
.put(EntityType.MLFEATURE_TABLE, Constants.ML_FEATURE_TABLE_ENTITY_NAME)
.put(EntityType.MLFEATURE, Constants.ML_FEATURE_ENTITY_NAME)
.put(EntityType.MLPRIMARY_KEY, Constants.ML_PRIMARY_KEY_ENTITY_NAME)
.put(EntityType.CONTAINER, Constants.CONTAINER_ENTITY_NAME)
.put(EntityType.DOMAIN, Constants.DOMAIN_ENTITY_NAME)
.put(EntityType.NOTEBOOK, Constants.NOTEBOOK_ENTITY_NAME)
.put(EntityType.INGESTION_SOURCE, Constants.INGESTION_SOURCE_ENTITY_NAME)
.put(EntityType.EXECUTION_REQUEST, Constants.EXECUTION_REQUEST_ENTITY_NAME)
.put(EntityType.ASSERTION, Constants.ASSERTION_ENTITY_NAME)
.put(EntityType.DATA_PROCESS_INSTANCE, Constants.DATA_PROCESS_INSTANCE_ENTITY_NAME)
.put(EntityType.DATA_PLATFORM_INSTANCE, Constants.DATA_PLATFORM_INSTANCE_ENTITY_NAME)
.put(EntityType.ACCESS_TOKEN, Constants.ACCESS_TOKEN_ENTITY_NAME)
.put(EntityType.TEST, Constants.TEST_ENTITY_NAME)
.put(EntityType.ER_MODEL_RELATIONSHIP, Constants.ER_MODEL_RELATIONSHIP_ENTITY_NAME)
.put(EntityType.DATAHUB_POLICY, Constants.POLICY_ENTITY_NAME)
.put(EntityType.DATAHUB_ROLE, Constants.DATAHUB_ROLE_ENTITY_NAME)
.put(EntityType.POST, Constants.POST_ENTITY_NAME)
.put(EntityType.SCHEMA_FIELD, Constants.SCHEMA_FIELD_ENTITY_NAME)
.put(EntityType.DATAHUB_VIEW, Constants.DATAHUB_VIEW_ENTITY_NAME)
.put(EntityType.QUERY, Constants.QUERY_ENTITY_NAME)
.put(EntityType.DATA_PRODUCT, Constants.DATA_PRODUCT_ENTITY_NAME)
.put(EntityType.SCHEMA_FIELD, Constants.SCHEMA_FIELD_ENTITY_NAME)
.put(EntityType.CUSTOM_OWNERSHIP_TYPE, Constants.OWNERSHIP_TYPE_ENTITY_NAME)
.put(EntityType.INCIDENT, Constants.INCIDENT_ENTITY_NAME)
.put(EntityType.ROLE, Constants.ROLE_ENTITY_NAME)
.put(EntityType.STRUCTURED_PROPERTY, Constants.STRUCTURED_PROPERTY_ENTITY_NAME)
.put(EntityType.ASSERTION, Constants.ASSERTION_ENTITY_NAME)
.put(EntityType.FORM, Constants.FORM_ENTITY_NAME)
.put(EntityType.DATA_TYPE, Constants.DATA_TYPE_ENTITY_NAME)
.put(EntityType.ENTITY_TYPE, Constants.ENTITY_TYPE_ENTITY_NAME)
.put(EntityType.RESTRICTED, Constants.RESTRICTED_ENTITY_NAME)
.put(EntityType.BUSINESS_ATTRIBUTE, Constants.BUSINESS_ATTRIBUTE_ENTITY_NAME)
.put(EntityType.QUERY, Constants.QUERY_ENTITY_NAME)
.put(EntityType.POST, Constants.POST_ENTITY_NAME)
.put(EntityType.FORM, Constants.FORM_ENTITY_NAME)
.build();

private static final Map<String, EntityType> ENTITY_NAME_TO_TYPE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,63 @@ public class EntityTypeUrnMapper {

static final Map<String, String> ENTITY_NAME_TO_ENTITY_TYPE_URN =
ImmutableMap.<String, String>builder()
.put(Constants.DOMAIN_ENTITY_NAME, "urn:li:entityType:datahub.domain")
.put(Constants.DATASET_ENTITY_NAME, "urn:li:entityType:datahub.dataset")
.put(Constants.ROLE_ENTITY_NAME, "urn:li:entityType:datahub.role")
.put(Constants.CORP_USER_ENTITY_NAME, "urn:li:entityType:datahub.corpuser")
.put(Constants.CORP_GROUP_ENTITY_NAME, "urn:li:entityType:datahub.corpGroup")
.put(Constants.DATA_PLATFORM_ENTITY_NAME, "urn:li:entityType:datahub.dataPlatform")
.put(
Constants.ER_MODEL_RELATIONSHIP_ENTITY_NAME,
"urn:li:entityType:datahub.erModelRelationship")
.put(Constants.DASHBOARD_ENTITY_NAME, "urn:li:entityType:datahub.dashboard")
.put(Constants.NOTEBOOK_ENTITY_NAME, "urn:li:entityType:datahub.notebook")
.put(Constants.CHART_ENTITY_NAME, "urn:li:entityType:datahub.chart")
.put(Constants.TAG_ENTITY_NAME, "urn:li:entityType:datahub.tag")
.put(Constants.DATA_FLOW_ENTITY_NAME, "urn:li:entityType:datahub.dataFlow")
.put(Constants.DATA_JOB_ENTITY_NAME, "urn:li:entityType:datahub.dataJob")
.put(Constants.TAG_ENTITY_NAME, "urn:li:entityType:datahub.tag")
.put(Constants.GLOSSARY_TERM_ENTITY_NAME, "urn:li:entityType:datahub.glossaryTerm")
.put(Constants.GLOSSARY_NODE_ENTITY_NAME, "urn:li:entityType:datahub.glossaryNode")
.put(Constants.CONTAINER_ENTITY_NAME, "urn:li:entityType:datahub.container")
.put(Constants.ML_MODEL_ENTITY_NAME, "urn:li:entityType:datahub.mlModel")
.put(Constants.ML_MODEL_GROUP_ENTITY_NAME, "urn:li:entityType:datahub.mlModelGroup")
.put(Constants.ML_FEATURE_TABLE_ENTITY_NAME, "urn:li:entityType:datahub.mlFeatureTable")
.put(Constants.ML_FEATURE_ENTITY_NAME, "urn:li:entityType:datahub.mlFeature")
.put(Constants.ML_PRIMARY_KEY_ENTITY_NAME, "urn:li:entityType:datahub.mlPrimaryKey")
.put(Constants.CONTAINER_ENTITY_NAME, "urn:li:entityType:datahub.container")
.put(Constants.DOMAIN_ENTITY_NAME, "urn:li:entityType:datahub.domain")
.put(Constants.NOTEBOOK_ENTITY_NAME, "urn:li:entityType:datahub.notebook")
.put(
Constants.INGESTION_SOURCE_ENTITY_NAME,
"urn:li:entityType:datahub.dataHubIngestionSource")
.put(
Constants.EXECUTION_REQUEST_ENTITY_NAME,
"urn:li:entityType:datahub.dataHubExecutionRequest")
.put(Constants.ASSERTION_ENTITY_NAME, "urn:li:entityType:datahub.assertion")
.put(
Constants.DATA_PROCESS_INSTANCE_ENTITY_NAME,
"urn:li:entityType:datahub.dataProcessInstance")
.put(
Constants.DATA_PLATFORM_INSTANCE_ENTITY_NAME,
"urn:li:entityType:datahub.dataPlatformInstance")
.put(Constants.ACCESS_TOKEN_ENTITY_NAME, "urn:li:entityType:datahub.dataHubAccessToken")
.put(Constants.TEST_ENTITY_NAME, "urn:li:entityType:datahub.test")
.put(Constants.POLICY_ENTITY_NAME, "urn:li:entityType:datahub.dataHubPolicy")
.put(Constants.DATAHUB_ROLE_ENTITY_NAME, "urn:li:entityType:datahub.dataHubRole")
.put(Constants.POST_ENTITY_NAME, "urn:li:entityType:datahub.post")
.put(Constants.SCHEMA_FIELD_ENTITY_NAME, "urn:li:entityType:datahub.schemaField")
.put(Constants.DATAHUB_VIEW_ENTITY_NAME, "urn:li:entityType:datahub.dataHubView")
.put(Constants.QUERY_ENTITY_NAME, "urn:li:entityType:datahub.query")
.put(Constants.DATA_PRODUCT_ENTITY_NAME, "urn:li:entityType:datahub.dataProduct")
.put(Constants.ASSERTION_ENTITY_NAME, "urn:li:entityType:datahub.assertion")
.put(Constants.SCHEMA_FIELD_ENTITY_NAME, "urn:li:entityType:datahub.schemaField")
.put(Constants.OWNERSHIP_TYPE_ENTITY_NAME, "urn:li:entityType:datahub.ownershipType")
.put(Constants.INCIDENT_ENTITY_NAME, "urn:li:entityType:datahub.incident")
.put(Constants.ROLE_ENTITY_NAME, "urn:li:entityType:datahub.role")
.put(
Constants.STRUCTURED_PROPERTY_ENTITY_NAME,
"urn:li:entityType:datahub.structuredProperty")
.put(Constants.FORM_ENTITY_NAME, "urn:li:entityType:datahub.form")
.put(Constants.DATA_TYPE_ENTITY_NAME, "urn:li:entityType:datahub.dataType")
.put(Constants.ENTITY_TYPE_ENTITY_NAME, "urn:li:entityType:datahub.entityType")
.put(Constants.RESTRICTED_ENTITY_NAME, "urn:li:entityType:datahub.restricted")
.put(
Constants.BUSINESS_ATTRIBUTE_ENTITY_NAME,
"urn:li:entityType:datahub.businessAttribute")
.build();

private static final Map<String, String> ENTITY_TYPE_URN_TO_NAME =
Expand Down

0 comments on commit aa07e2a

Please sign in to comment.