Commit 8a26c79e by Ashutosh Mestry

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

parent 7763fd0d
...@@ -26,7 +26,7 @@ import java.util.List; ...@@ -26,7 +26,7 @@ import java.util.List;
import static org.apache.atlas.entitytransform.TransformationConstants.*; import static org.apache.atlas.entitytransform.TransformationConstants.*;
public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler { 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) { public HiveStorageDescriptorEntityHandler(List<AtlasEntityTransformer> transformers) {
...@@ -90,6 +90,9 @@ public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler { ...@@ -90,6 +90,9 @@ public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler {
case HIVE_DB_CLUSTER_NAME_ATTRIBUTE: case HIVE_DB_CLUSTER_NAME_ATTRIBUTE:
return clusterName; return clusterName;
case HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE:
return location;
} }
return super.getAttribute(attribute); return super.getAttribute(attribute);
...@@ -116,6 +119,10 @@ public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler { ...@@ -116,6 +119,10 @@ public class HiveStorageDescriptorEntityHandler extends BaseEntityHandler {
isCustomAttributeUpdated = true; isCustomAttributeUpdated = true;
break; break;
case HIVE_STORAGE_DESC_LOCATION_ATTRIBUTE:
location = attributeValue;
break;
default: default:
super.setAttribute(attribute, attributeValue); super.setAttribute(attribute, attributeValue);
break; break;
......
...@@ -37,6 +37,7 @@ public final class TransformationConstants { ...@@ -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_NAME_ATTRIBUTE = "hdfs_path.name";
public static final String HDFS_PATH_PATH_ATTRIBUTE = "hdfs_path.path"; 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 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 TYPE_NAME_ATTRIBUTE_NAME_SEP = '.';
public static final char CLUSTER_DELIMITER = '@'; public static final char CLUSTER_DELIMITER = '@';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment