ATLAS-2906: Allow transforms to be applied when entity-level transforms are 
present.


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7f170c86
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7f170c86
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7f170c86

Branch: refs/heads/branch-1.0
Commit: 7f170c8603a28f49b92b578ec9dc5eb3bc457274
Parents: a9ffa99
Author: Ashutosh Mestry <ames...@hortonworks.com>
Authored: Wed Oct 3 18:08:51 2018 -0700
Committer: Ashutosh Mestry <ames...@hortonworks.com>
Committed: Thu Nov 1 15:42:57 2018 -0700

----------------------------------------------------------------------
 .../entitytransform/HiveStorageDescriptorEntityHandler.java | 9 ++++++++-
 .../atlas/entitytransform/TransformationConstants.java      | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/7f170c86/intg/src/main/java/org/apache/atlas/entitytransform/HiveStorageDescriptorEntityHandler.java
----------------------------------------------------------------------
diff --git 
a/intg/src/main/java/org/apache/atlas/entitytransform/HiveStorageDescriptorEntityHandler.java
 
b/intg/src/main/java/org/apache/atlas/entitytransform/HiveStorageDescriptorEntityHandler.java
index dc4edfb..38de206 100644
--- 
a/intg/src/main/java/org/apache/atlas/entitytransform/HiveStorageDescriptorEntityHandler.java
+++ 
b/intg/src/main/java/org/apache/atlas/entitytransform/HiveStorageDescriptorEntityHandler.java
@@ -26,7 +26,7 @@ import java.util.List;
 import static org.apache.atlas.entitytransform.TransformationConstants.*;
 
 public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler {
-    static final List<String> CUSTOM_TRANSFORM_ATTRIBUTES = 
Arrays.asList(HIVE_DB_NAME_ATTRIBUTE, HIVE_TABLE_NAME_ATTRIBUTE, 
HIVE_DB_CLUSTER_NAME_ATTRIBUTE);
+    static final List<String> CUSTOM_TRANSFORM_ATTRIBUTES = 
Arrays.asList(HIVE_DB_NAME_ATTRIBUTE, HIVE_TABLE_NAME_ATTRIBUTE, 
HIVE_DB_CLUSTER_NAME_ATTRIBUTE, HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE);
 
 
     public HiveStorageDescriptorEntityHandler(List<AtlasEntityTransformer> 
transformers) {
@@ -90,6 +90,9 @@ public class HiveStorageDescriptorEntityHandler extends 
BaseEntityHandler {
 
                 case HIVE_DB_CLUSTER_NAME_ATTRIBUTE:
                     return clusterName;
+
+                case HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE:
+                    return location;
             }
 
             return super.getAttribute(attribute);
@@ -116,6 +119,10 @@ public class HiveStorageDescriptorEntityHandler extends 
BaseEntityHandler {
                     isCustomAttributeUpdated = true;
                 break;
 
+                case HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE:
+                    location = attributeValue;
+                break;
+
                 default:
                     super.setAttribute(attribute, attributeValue);
                 break;

http://git-wip-us.apache.org/repos/asf/atlas/blob/7f170c86/intg/src/main/java/org/apache/atlas/entitytransform/TransformationConstants.java
----------------------------------------------------------------------
diff --git 
a/intg/src/main/java/org/apache/atlas/entitytransform/TransformationConstants.java
 
b/intg/src/main/java/org/apache/atlas/entitytransform/TransformationConstants.java
index 51c3ace..247de73 100644
--- 
a/intg/src/main/java/org/apache/atlas/entitytransform/TransformationConstants.java
+++ 
b/intg/src/main/java/org/apache/atlas/entitytransform/TransformationConstants.java
@@ -37,6 +37,7 @@ public final class TransformationConstants {
     public static final String HDFS_PATH_NAME_ATTRIBUTE       = 
"hdfs_path.name";
     public static final String HDFS_PATH_PATH_ATTRIBUTE       = 
"hdfs_path.path";
     public static final String HDFS_CLUSTER_NAME_ATTRIBUTE    = 
"hdfs_path.clusterName";
+    public static final String HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE = 
"hive_storagedesc.location";
 
     public static final char   TYPE_NAME_ATTRIBUTE_NAME_SEP = '.';
     public static final char   CLUSTER_DELIMITER            = '@';

Reply via email to