Skip to content

ATLAS-5156: Import failure due to missing support for handling multip…#478

Open
sheetalshah1007 wants to merge 5 commits intoapache:masterfrom
sheetalshah1007:ATLAS-5156
Open

ATLAS-5156: Import failure due to missing support for handling multip…#478
sheetalshah1007 wants to merge 5 commits intoapache:masterfrom
sheetalshah1007:ATLAS-5156

Conversation

@sheetalshah1007
Copy link
Copy Markdown
Contributor

@sheetalshah1007 sheetalshah1007 commented Nov 25, 2025

…le relationship types under a single attribute

What changes were proposed in this pull request?

Atlas handles relationships during import using EntityGraphMapper. Earlier, it assumed that an attribute (like tables) would have only one relationship type for all its values. Because of this, when different table types (e.g., managed and external tables) were present, it picked a single relationship type for the entire list. This caused issues when the list contained mixed types, leading to incorrect handling during import and updates.

This patch fixes how Atlas handles relationships during import when an attribute contains mixed relationship types.

It introduces a new method, mapRelationshipAttributeWithMultipleTypes. Instead of processing all values together, Atlas now:

  • Checks whether an attribute can have multiple relationship types
  • Splits the values based on each item’s relationship type
  • Processes each group separately using the appropriate relationship

In short, rather than treating all values the same, Atlas now correctly handles mixed types. This ensures accurate imports for cases where different table types (such as managed and external tables) coexist, avoiding errors or incorrect relationships.

How was this patch tested?

A dedicated test class, EntityGraphMapperMultipleRelationshipTypesTest, is introduced to:

  • Verify mixed table-type collections are correctly split and mapped
  • Ensure the correct relationshipDefs are used
  • Confirm invalid element types are ignored and do not create relationships

Summary of Manual Testing:

Performance:
Ran large imports (up to 100K tables) on two clusters—with and without the fix—using the same data. Import times are very similar, indicating no performance impact..

Results:

1000 tables: ~3m40s → ~3m58s

10000 tables: ~37m → ~38m

50000 tables: ~3h03m → ~3h15m

100000 tables: ~6h44m → ~6h39m

Multiple relationship types:
Tested importing a mix of different table types (e.g., managed and external tables). Verified that all types are imported correctly and their relationships are created as expected.

Partition columns:
Tested partitioned tables to ensure partition columns and regular columns continue to be handled correctly after the fix.

Overall correctness:
Confirmed that all entities and relationships are created correctly, even when different types are mixed together.

Conclusion:
The fix works as expected and does not impact performance. It ensures correct handling of mixed relationship types during import.

@sheetalshah1007 sheetalshah1007 force-pushed the ATLAS-5156 branch 2 times, most recently from 0a4f7b3 to 75f6190 Compare December 12, 2025 10:27
@sheetalshah1007 sheetalshah1007 force-pushed the ATLAS-5156 branch 2 times, most recently from af13a84 to 85e2798 Compare January 5, 2026 12:25
Copy link
Copy Markdown
Contributor Author

@sheetalshah1007 sheetalshah1007 left a comment

Choose a reason for hiding this comment

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

@pinal-shah All review feedback has been addressed in code, comments, or review replies as appropriate. Please check

… relationship defs and value is a collection
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.

4 participants