You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2021/03/18 19:07:04 UTC
[atlas] branch branch-2.0 updated: ATLAS-4211: DSL Search:
Regression: When fetching string attribute with null value returns null ,
earlier versions returned empty
This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 947f4bd ATLAS-4211: DSL Search: Regression: When fetching string attribute with null value returns null , earlier versions returned empty
947f4bd is described below
commit 947f4bd60603fb4fed65201587e685e3391ffbdd
Author: Pinal <pinal-shah>
AuthorDate: Tue Mar 16 21:54:54 2021 +0530
ATLAS-4211: DSL Search: Regression: When fetching string attribute with null value returns null , earlier versions returned empty
Signed-off-by: Sarath Subramanian <sa...@apache.org>
(cherry picked from commit 83aa1f45b9aebea50c9e6c0847d16a821978ddd5)
---
.../org/apache/atlas/query/executors/SelectClauseProjections.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/repository/src/main/java/org/apache/atlas/query/executors/SelectClauseProjections.java b/repository/src/main/java/org/apache/atlas/query/executors/SelectClauseProjections.java
index 7018c15..8305477 100644
--- a/repository/src/main/java/org/apache/atlas/query/executors/SelectClauseProjections.java
+++ b/repository/src/main/java/org/apache/atlas/query/executors/SelectClauseProjections.java
@@ -24,6 +24,7 @@ import org.apache.atlas.query.GremlinQuery;
import org.apache.atlas.query.SelectClauseComposer;
import org.apache.atlas.repository.graphdb.AtlasVertex;
import org.apache.atlas.repository.store.graph.v2.EntityGraphRetriever;
+import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -130,8 +131,8 @@ public class SelectClauseProjections {
} else {
if (selectClauseComposer.isPrimitiveAttribute(idx)) {
String propertyName = selectClauseComposer.getAttribute(idx);
-
- row.add(vertex.getProperty(propertyName, Object.class));
+ Object value = vertex.getProperty(propertyName, Object.class);
+ row.add(value != null ? value : StringUtils.EMPTY);
} else {
row.add(entityRetriever.toAtlasEntityHeaderWithClassifications(vertex));
}