You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by am...@apache.org on 2017/09/14 02:06:14 UTC
atlas git commit: ATLAS-2134: Code Improvements.
Repository: atlas
Updated Branches:
refs/heads/master 1dc7f5499 -> 8eb9c9567
ATLAS-2134: Code Improvements.
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8eb9c956
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8eb9c956
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8eb9c956
Branch: refs/heads/master
Commit: 8eb9c95677c0466835fc5aa6cbcfa630616cbd3b
Parents: 1dc7f54
Author: ashutoshm <am...@hortonworks.com>
Authored: Wed Sep 13 19:05:41 2017 -0700
Committer: ashutoshm <am...@hortonworks.com>
Committed: Wed Sep 13 19:06:04 2017 -0700
----------------------------------------------------------------------
.../apache/atlas/repository/impexp/ZipSource.java | 2 +-
.../atlas/query/GraphPersistenceStrategies.scala | 2 ++
.../scala/org/apache/atlas/query/QueryParser.scala | 17 ++++++++++-------
3 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/8eb9c956/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
index 4c23582..bd51d3b 100644
--- a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
+++ b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
@@ -175,7 +175,7 @@ public class ZipSource implements EntityImportStream {
currentPosition++;
return getEntityWithExtInfo(this.iterator.next());
} catch (AtlasBaseException e) {
- e.printStackTrace();
+ LOG.error("getNextEntityWithExtInfo", e);
return null;
}
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/8eb9c956/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
----------------------------------------------------------------------
diff --git a/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala b/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
index 752a522..c2b3436 100755
--- a/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
+++ b/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
@@ -284,6 +284,8 @@ case class GraphPersistenceStrategy1(g: AtlasGraph[_,_]) extends GraphPersistenc
case DataTypes.TypeCategory.TRAIT =>
throw new UnsupportedOperationException(s"load for ${aInfo.dataType()} not supported")
case DataTypes.TypeCategory.CLASS => loadStructAttribute(dataType, aInfo, i, v)
+ case DataTypes.TypeCategory.RELATIONSHIP =>
+ throw new UnsupportedOperationException(s"load for ${aInfo.dataType()} not supported")
}
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/8eb9c956/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
----------------------------------------------------------------------
diff --git a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
index 7b7cd98..4bc6e74 100755
--- a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
+++ b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
@@ -233,6 +233,7 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with Expressi
def querySrc: Parser[Expression] = rep1sep(singleQrySrc, opt(COMMA)) ^^ { l => l match {
case h :: Nil => h
case h :: t => t.foldLeft(h)(merge(_, _))
+ case Nil => null
}
}
@@ -277,21 +278,21 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with Expressi
case o ~ odr ~ None => (odr, true)
case o ~ odr ~ asc => (odr, asc.get)
}
-
+
def limitOffset: Parser[(Int, Int)] = LIMIT ~ lmt ~ opt (offset) ^^ {
case l ~ lt ~ None => (lt.toInt, 0)
case l ~ lt ~ of => (lt.toInt, of.get.toInt)
}
-
+
def offset = OFFSET ~ ofset ^^ {
case offset ~ of => of
}
-
+
def asce = asc ^^ {
case DESC => false
case _ => true
}
-
+
def loopExpression(implicit queryParams: QueryParams): Parser[(Expression, Option[Literal[Integer]], Option[String])] =
LOOP ~ (LPAREN ~> query <~ RPAREN) ~ opt(intConstant <~ TIMES) ~ opt(AS ~> alias) ^^ {
case l ~ e ~ None ~ a => (e, None, a)
@@ -361,17 +362,19 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with Expressi
case h :: t => { //the left-most part of the identifier (h) can be
t.foldLeft(id(h).asInstanceOf[Expression])(_.field(_))
}
+
+ case Nil => null
}
}
def alias = ident | stringLit
-
+
def lmt = intConstant
-
+
def ofset = intConstant
def asc = ident | stringLit
-
+
def literal = booleanConstant ^^ {
boolean(_)
} |