You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ap...@apache.org on 2017/11/10 00:18:10 UTC

atlas git commit: ATLAS-2251: Lineage/DataSetLineage (schema fixes #2)

Repository: atlas
Updated Branches:
  refs/heads/ATLAS-2251 fe4535979 -> f3835b647


ATLAS-2251: Lineage/DataSetLineage (schema fixes #2)


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

Branch: refs/heads/ATLAS-2251
Commit: f3835b647d439f7fa224a32a40585e637aa553d8
Parents: fe45359
Author: apoorvnaik <ap...@apache.org>
Authored: Thu Nov 9 16:17:59 2017 -0800
Committer: apoorvnaik <ap...@apache.org>
Committed: Thu Nov 9 16:17:59 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/atlas/type/AtlasTypeUtil.java    | 10 ++++++----
 .../atlas/v1/model/lineage/SchemaResponse.java       |  9 ---------
 pom.xml                                              | 15 ++++-----------
 .../apache/atlas/discovery/EntityLineageService.java |  2 --
 4 files changed, 10 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/f3835b64/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
index 5cb74de..80c6a0c 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
@@ -17,6 +17,7 @@
  */
 package org.apache.atlas.type;
 
+import org.apache.atlas.model.instance.AtlasClassification;
 import org.apache.atlas.model.instance.AtlasEntity;
 import org.apache.atlas.model.instance.AtlasEntityHeader;
 import org.apache.atlas.model.instance.AtlasObjectId;
@@ -509,7 +510,7 @@ public class AtlasTypeUtil {
             if (CollectionUtils.isNotEmpty(entity.getClassifications())) {
                 Map<String, HashMap> traitDetails = entity.getClassifications()
                                                           .stream()
-                                                          .collect(Collectors.toMap(AtlasStruct::getTypeName, c -> getNestedTraitDetails(c.getTypeName())));
+                                                          .collect(Collectors.toMap(AtlasStruct::getTypeName, AtlasTypeUtil::getNestedTraitDetails));
                 ret.put("$traits$", traitDetails);
             }
 
@@ -534,9 +535,10 @@ public class AtlasTypeUtil {
         return ret;
     }
 
-    private static HashMap getNestedTraitDetails(final Object typeName) {
-        return new HashMap() {{
-            put("$typeName$", typeName);
+    private static HashMap getNestedTraitDetails(final AtlasClassification atlasClassification) {
+        return new HashMap<String, Object>() {{
+            put("$typeName$", atlasClassification.getTypeName());
+            putAll(atlasClassification.getAttributes());
         }};
     }
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/f3835b64/intg/src/main/java/org/apache/atlas/v1/model/lineage/SchemaResponse.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/v1/model/lineage/SchemaResponse.java b/intg/src/main/java/org/apache/atlas/v1/model/lineage/SchemaResponse.java
index 837668b..56d8226 100644
--- a/intg/src/main/java/org/apache/atlas/v1/model/lineage/SchemaResponse.java
+++ b/intg/src/main/java/org/apache/atlas/v1/model/lineage/SchemaResponse.java
@@ -70,21 +70,12 @@ public class SchemaResponse {
     @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
     @JsonIgnoreProperties(ignoreUnknown = true)
     public static class SchemaDetails {
-        private String                    query;      // The DSL query representation for obtaining schema
         private ClassTypeDefinition       dataType;   // Data type of the (hive) columns
         private List<Map<String, Object>> rows;       // Column instances for the given table
 
         public SchemaDetails() {
         }
 
-        public String getQuery() {
-            return query;
-        }
-
-        public void setQuery(final String query) {
-            this.query = query;
-        }
-
         public ClassTypeDefinition getDataType() {
             return dataType;
         }

http://git-wip-us.apache.org/repos/asf/atlas/blob/f3835b64/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 35b0fec..fdf42a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -800,7 +800,6 @@
 
     <dependencyManagement>
         <dependencies>
-
             <dependency>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
@@ -1671,6 +1670,10 @@
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.7.0</version>
+                    <configuration>
+                        <source>1.8</source>
+                        <target>1.8</target>
+                    </configuration>
                 </plugin>
 
                 <plugin>
@@ -1802,16 +1805,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.7.0</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                    <optimize>true</optimize>
-                </configuration>
-            </plugin>
 
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/atlas/blob/f3835b64/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 9d96de9..f49e622 100644
--- a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -124,8 +124,6 @@ public class EntityLineageService implements AtlasLineageService {
         SchemaDetails ret = new SchemaDetails();
         AtlasEntityType hive_column = atlasTypeRegistry.getEntityTypeByName("hive_column");
 
-        // TODO: Form and set the query, might not even be needed if DSL is gone forever
-        ret.setQuery("");
         ret.setDataType(AtlasTypeUtil.toClassTypeDefinition(hive_column));
 
         AtlasEntity.AtlasEntityWithExtInfo entityWithExtInfo = entityRetriever.toAtlasEntityWithExtInfo(guid);