Skip to content

Conversation

@UmeshPatil-1
Copy link

ATLAS-5159

What changes were proposed in this pull request?

Background:
Exporting entities of a parent type (e.g., Referenceable) does not export entities of its child type (e.g., hive_table).
When attempting to export using the parent type with unique attributes, no child entities were returned, leading to incomplete exports.

Root Cause:

The export logic in StartEntityFetchByExportRequest did not properly handle abstract or parent types.
Methods like getEntitiesForMatchTypeType() and getEntitiesForMatchTypeUsingUniqueAttributes() only fetched concrete types when specified, ignoring child entities.

Changes Proposed:

  1. Refactored StartEntityFetchByExportRequest to properly handle unique attribute lookups.
  2. Updated getEntitiesForMatchTypeType() to include all subtypes of a parent type during export.
  3. Simplified getEntitiesForMatchTypeUsingUniqueAttributes() for better performance and maintainability.
  4. Updated getBindingsForTypeName() to ensure all subtypes are included in queries.
  5. Improved logging and error handling for clarity.

Impact:

  • Exporting parent types like Referenceable now correctly includes all child entities.
  • Maintains consistent behavior for all fetch types (FULL, INCREMENTAL, CONNECTED).
  • Minimal impact on performance; no additional schema changes are required.

How was this patch tested?

  • Maven Build:- Build Successfull.
  • Manual testing of export requests with all three fetch types: FULL, INCREMENTAL, CONNECTED.
  • Verified entity GUIDs are correctly returned for parent types and child entities.
  • Confirmed behavior for concrete types, abstract types, and invalid/misspelled types.
  • Logs verified query execution, fetch type handling, and error reporting.

@UmeshPatil-1 UmeshPatil-1 changed the title ATLAS-5159: Resolve Exporting Parent type doesn't export child type i… Export APIs: Exporting parent type doesn't export child typev Dec 15, 2025
@UmeshPatil-1 UmeshPatil-1 changed the title Export APIs: Exporting parent type doesn't export child typev Export APIs: Exporting parent type doesn't export child type Dec 15, 2025

private List<String> getEntitiesForMatchTypeType(AtlasObjectId item, String matchType) {
return executeGremlinQuery(getQueryTemplateForMatchType(matchType), getBindingsForTypeName(item.getTypeName()));
private List<String> getEntitiesForMatchTypeType(AtlasObjectId item, String matchType) throws AtlasBaseException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add UTS for each usecase to cover scenarios and regression behaviour

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added UTS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants