Skip to content

ATLAS-5310: Export/Import API : When tag attributes types get modified between th…#662

Merged
rkundam merged 2 commits into
apache:masterfrom
saksenasonali:ATLAS-5310
Jun 12, 2026
Merged

ATLAS-5310: Export/Import API : When tag attributes types get modified between th…#662
rkundam merged 2 commits into
apache:masterfrom
saksenasonali:ATLAS-5310

Conversation

@saksenasonali

@saksenasonali saksenasonali commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?
Fixes Replication Manager export/import when a classification (tag) attribute type changes between exports (e.g. string → double after the tag is deleted and recreated on the source with the same name). Previously, incremental import failed with INVALID_IMPORT_ATTRIBUTE_TYPE_CHANGED or a JanusGraph schema error because the target kept the old typedef and property key types.

Changes:

TypeAttributeDifference — When an attribute already exists but its typeName differs, treat the incoming definition as an update (via addAttribute) instead of throwing INVALID_IMPORT_ATTRIBUTE_TYPE_CHANGED.

AtlasStructDefStoreV2 — During import (RequestContext.isImportInProgress()), allow persisting typedef attribute data-type changes and serialize the new attribute definition from the import payload.

GraphBackedSearchIndexer — During import, if an existing JanusGraph property key’s data type no longer matches the typedef, delete and recreate the property key so classification values can be stored with the new type.

AtlasGraphManagement / AtlasJanusGraphManagement — Add propertyKeyHasDataType() to detect property key / data-type mismatches.

How was this patch tested?
Unit / integration tests

mvn -pl repository -Dtest=TypeAttributeDifferenceTest,ImportServiceTest#importHdfs_path1 test
mvn -pl graphdb/janus -Dtest=AtlasJanusGraphManagementTest test
TypeAttributeDifferenceTest#attributeTypeChanged_ReturnsUpdatedAttribute — Verifies changed attribute types are included in the typedef diff for import.
ImportServiceTest#importHdfs_path1 — End-to-end import scenario: pre-existing tag with attrib1=date, import zip with attrib1=string; import succeeds and typedef is updated (previously expected failure).
AtlasJanusGraphManagementTest — Covers new propertyKeyHasDataType API.
Manual / cluster E2E (Replication Manager flow)

Create table + tag (a = string), associate a="abc", full incremental export (changeMarker=0), import to target
Disassociate tag, delete tag, recreate tag (a = double), associate a=3.14, incremental export, import to target
Verify target typedef has a: double and classification value 3.14

@rkundam rkundam merged commit ac00c0f into apache:master Jun 12, 2026
1 check passed
asf-gitbox-commits pushed a commit that referenced this pull request Jun 12, 2026
…d between th… (#662)

Co-authored-by: ssaksena <ssaksena@cloudera.com>
(cherry picked from commit ac00c0f)
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.

3 participants