Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
88ca02c6
Commit
88ca02c6
authored
8 years ago
by
Madhan Neethiraj
Committed by
kevalbhatt
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1603: fix to handle null value for object_id type attributes
parent
0feb60a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
9 deletions
+40
-9
release-log.txt
release-log.txt
+4
-0
EntityGraphMapper.java
...he/atlas/repository/store/graph/v1/EntityGraphMapper.java
+16
-9
AtlasEntityStoreV1Test.java
...las/repository/store/graph/v1/AtlasEntityStoreV1Test.java
+20
-0
No files found.
release-log.txt
View file @
88ca02c6
...
@@ -9,6 +9,10 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
...
@@ -9,6 +9,10 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ALL CHANGES:
ATLAS-1603: fix to handle null value for object_id type attributes (mneethiraj via kevalbhatt)
ATLAS 1607: notify listeners on classification addition/deletion (sarathkumarsubramanian via mneethiraj)
ATLAS-1606: introduced query provider to handle Gremlin version specific queries (apoorvnaik via mneethiraj)
ATLAS-1602 fixed IT failures in QuickStart and issues identified in coverity scan (sarathkumarsubramanian via mneethiraj)
ATLAS-1584 Fix issues with owned map reference and add tests (sumasai)
ATLAS-1584 Fix issues with owned map reference and add tests (sumasai)
ATLAS-1589 DSL queries return wrong object when filter traverses an edge (jnhagelberg)
ATLAS-1589 DSL queries return wrong object when filter traverses an edge (jnhagelberg)
ATLAS-1590 UI : Edit Button is enabled for Deleted entities. (kevalbhatt)
ATLAS-1590 UI : Edit Button is enabled for Deleted entities. (kevalbhatt)
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java
View file @
88ca02c6
...
@@ -282,15 +282,19 @@ public class EntityGraphMapper {
...
@@ -282,15 +282,19 @@ public class EntityGraphMapper {
}
}
case
OBJECT_ID_TYPE:
{
case
OBJECT_ID_TYPE:
{
String
edgeLabel
=
AtlasGraphUtilsV1
.
getEdgeLabel
(
ctx
.
getVertexProperty
());
String
edgeLabel
=
AtlasGraphUtilsV1
.
getEdgeLabel
(
ctx
.
getVertexProperty
());
AtlasEdge
currentEdge
=
graphHelper
.
getEdgeForLabel
(
ctx
.
getReferringVertex
(),
edgeLabel
);
AtlasEdge
currentEdge
=
graphHelper
.
getEdgeForLabel
(
ctx
.
getReferringVertex
(),
edgeLabel
);
AtlasEntityType
instanceType
=
getInstanceType
(
ctx
.
getValue
());
AtlasEdge
newEdge
=
null
;
AtlasEdge
edge
=
currentEdge
!=
null
?
currentEdge
:
null
;
ctx
.
setElementType
(
instanceType
);
if
(
ctx
.
getValue
()
!=
null
)
{
ctx
.
setExistingEdge
(
edge
);
AtlasEntityType
instanceType
=
getInstanceType
(
ctx
.
getValue
());
AtlasEdge
edge
=
currentEdge
!=
null
?
currentEdge
:
null
;
ctx
.
setElementType
(
instanceType
);
ctx
.
setExistingEdge
(
edge
);
AtlasEdge
newEdge
=
mapObjectIdValue
(
ctx
,
context
);
newEdge
=
mapObjectIdValue
(
ctx
,
context
);
}
if
(
currentEdge
!=
null
&&
!
currentEdge
.
equals
(
newEdge
))
{
if
(
currentEdge
!=
null
&&
!
currentEdge
.
equals
(
newEdge
))
{
deleteHandler
.
deleteEdgeReference
(
currentEdge
,
ctx
.
getAttrType
().
getTypeCategory
(),
ctx
.
getAttribute
().
isOwnedRef
(),
true
);
deleteHandler
.
deleteEdgeReference
(
currentEdge
,
ctx
.
getAttrType
().
getTypeCategory
(),
ctx
.
getAttribute
().
isOwnedRef
(),
true
);
...
@@ -371,11 +375,14 @@ public class EntityGraphMapper {
...
@@ -371,11 +375,14 @@ public class EntityGraphMapper {
if
(
entityVertex
==
null
)
{
if
(
entityVertex
==
null
)
{
AtlasObjectId
objId
=
getObjectId
(
ctx
.
getValue
());
AtlasObjectId
objId
=
getObjectId
(
ctx
.
getValue
());
entityVertex
=
context
.
getDiscoveryContext
().
getResolvedEntityVertex
(
objId
);
if
(
objId
!=
null
)
{
entityVertex
=
context
.
getDiscoveryContext
().
getResolvedEntityVertex
(
objId
);
}
}
}
if
(
entityVertex
==
null
)
{
if
(
entityVertex
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_OBJECT_ID
,
ctx
.
getValue
().
toString
(
));
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_OBJECT_ID
,
(
ctx
.
getValue
()
==
null
?
null
:
ctx
.
getValue
().
toString
()
));
}
}
if
(
ctx
.
getCurrentEdge
()
!=
null
)
{
if
(
ctx
.
getCurrentEdge
()
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java
View file @
88ca02c6
...
@@ -75,6 +75,7 @@ import static org.apache.atlas.TestUtils.randomString;
...
@@ -75,6 +75,7 @@ import static org.apache.atlas.TestUtils.randomString;
import
static
org
.
apache
.
atlas
.
TestUtilsV2
.
TABLE_TYPE
;
import
static
org
.
apache
.
atlas
.
TestUtilsV2
.
TABLE_TYPE
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertNull
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
@Guice
(
modules
=
RepositoryMetadataModule
.
class
)
@Guice
(
modules
=
RepositoryMetadataModule
.
class
)
...
@@ -811,6 +812,25 @@ public class AtlasEntityStoreV1Test {
...
@@ -811,6 +812,25 @@ public class AtlasEntityStoreV1Test {
assertEquals
(
col3
.
getAttribute
(
"description"
),
updatedCol3Entity
.
getAttribute
(
"description"
));
assertEquals
(
col3
.
getAttribute
(
"description"
),
updatedCol3Entity
.
getAttribute
(
"description"
));
}
}
@Test
public
void
testSetObjectIdAttrToNull
()
throws
Exception
{
final
AtlasEntity
dbEntity
=
TestUtilsV2
.
createDBEntity
();
EntityMutationResponse
dbCreationResponse
=
entityStore
.
createOrUpdate
(
new
AtlasEntityStream
(
dbEntity
),
false
);
final
AtlasEntity
tableEntity
=
TestUtilsV2
.
createTableEntity
(
dbEntity
);
final
EntityMutationResponse
tblCreationResponse
=
entityStore
.
createOrUpdate
(
new
AtlasEntityStream
(
tableEntity
),
false
);
final
AtlasEntityHeader
createdTblHeader
=
tblCreationResponse
.
getCreatedEntityByTypeNameAndAttribute
(
TABLE_TYPE
,
NAME
,
(
String
)
tableEntity
.
getAttribute
(
NAME
));
final
AtlasEntity
createdTblEntity
=
getEntityFromStore
(
createdTblHeader
);
init
();
createdTblEntity
.
setAttribute
(
"database"
,
null
);
final
EntityMutationResponse
tblUpdateResponse
=
entityStore
.
createOrUpdate
(
new
AtlasEntityStream
(
createdTblEntity
),
true
);
final
AtlasEntityHeader
updatedTblHeader
=
tblUpdateResponse
.
getFirstEntityPartialUpdated
();
final
AtlasEntity
updatedTblEntity
=
getEntityFromStore
(
updatedTblHeader
);
assertNull
(
updatedTblEntity
.
getAttribute
(
"database"
));
}
private
String
randomStrWithReservedChars
()
{
private
String
randomStrWithReservedChars
()
{
return
randomString
()
+
"\"${}%"
;
return
randomString
()
+
"\"${}%"
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment