-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71831/
-----------------------------------------------------------
(Updated Nov. 28, 2019, 8:56 a.m.)
Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues,
and Sarath Subramanian.
Changes
-------
Addressed review comments,
getHiveMetastoreEntities() method gets called from 2 places, 1.
AlterDatabase.getNotificationMessages() and 2.
CreateDatabase.getNotificationMessages()
In both the cases only when context.isMetastoreHook() == true.
Therefore we don't need to check context.isMetastoreHook() in method
getHiveMetastoreEntities()
Bugs: ATLAS-3539
https://issues.apache.org/jira/browse/ATLAS-3539
Repository: atlas
Description
-------
Issue:- Difference in information sent to ATLAS_HOOK while database creation
from Beeline and Spark.
Observation:-
When we fetch database entity by MetastoreEvent object, we don't get ownerType
attribute.
But when we fetch database entity by MetastoreHandler object, we get ownerType
attribute for the database.
Fix:-
At the time of Table creation from the Spark-Client, our code fetches Database
object by using MetastoreHandler, there we can get ownerType in Database.
Therefore here I have used MetastoreHandler object to fetch Database object.
Also handled the description attribute null and empty case.
Diffs (updated)
-----
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
851582c
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateDatabase.java
7bea779
Diff: https://reviews.apache.org/r/71831/diff/2/
Changes: https://reviews.apache.org/r/71831/diff/1-2/
Testing
-------
Manual testing done as follwos
1. Database created from beeling client.
2. Cheked for the json sent to ATLAS-HOOK, here attribute ownerType was present.
3. Database create from Spark client.
4. Checked for the json sent to ATLAS-HOOK, here attribute ownerType was
present.
PreCommit build is successful.
https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1565/console
Thanks,
Mandar Ambawane