You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rya.apache.org by mi...@apache.org on 2016/02/22 20:52:53 UTC
[1/3] incubator-rya git commit: RYA-37 Bump GeoMesa version to 1.2.0
Repository: incubator-rya
Updated Branches:
refs/heads/develop 3157bc466 -> 1a3839607
RYA-37 Bump GeoMesa version to 1.2.0
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/6b294469
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/6b294469
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/6b294469
Branch: refs/heads/develop
Commit: 6b2944693ac5bc4ef0ea9e067715c63c9b78bf88
Parents: 3157bc4
Author: Mike Pfaffenberger <mp...@ccri.com>
Authored: Thu Feb 18 09:47:09 2016 -0500
Committer: Mike Pfaffenberger <mp...@ccri.com>
Committed: Thu Feb 18 09:47:09 2016 -0500
----------------------------------------------------------------------
extras/indexingExample/pom.xml | 2 +-
extras/indexingExample/src/main/assembly/assembly.xml | 2 +-
pom.xml | 6 ++----
3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6b294469/extras/indexingExample/pom.xml
----------------------------------------------------------------------
diff --git a/extras/indexingExample/pom.xml b/extras/indexingExample/pom.xml
index 1150a80..394af94 100644
--- a/extras/indexingExample/pom.xml
+++ b/extras/indexingExample/pom.xml
@@ -62,7 +62,7 @@ under the License.
<dependency>
<groupId>org.locationtech.geomesa</groupId>
- <artifactId>geomesa-distributed-runtime</artifactId>
+ <artifactId>geomesa-accumulo-distributed-runtime</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6b294469/extras/indexingExample/src/main/assembly/assembly.xml
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/assembly/assembly.xml b/extras/indexingExample/src/main/assembly/assembly.xml
index 0e8fd6d..98dec7f 100644
--- a/extras/indexingExample/src/main/assembly/assembly.xml
+++ b/extras/indexingExample/src/main/assembly/assembly.xml
@@ -32,7 +32,7 @@ under the License.
<outputDirectory>accumulo/lib/ext</outputDirectory>
<includes>
<include>org.apache.rya:rya.indexing:*:accumulo-server</include>
- <include>org.locationtech.geomesa:geomesa-distributed-runtime:*</include>
+ <include>org.locationtech.geomesa:geomesa-accumulo-distributed-runtime:*</include>
</includes>
</dependencySet>
<dependencySet>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/6b294469/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4d55822..b6eace5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,7 @@ under the License.
<pig.version>0.9.2</pig.version> <!-- Newest: 0.15.0 -->
- <geomesa.version>1.1.0-rc.6</geomesa.version> <!-- Newest: 1.1.0-rc.6 -->
+ <geomesa.version>1.2.0</geomesa.version> <!-- Newest: 1.2.0 -->
<lucene.version>3.6.2</lucene.version> <!-- Newest: 5.3.1 -->
<joda-time.version>2.1</joda-time.version> <!-- Newest: 2.9.1 -->
@@ -168,13 +168,11 @@ under the License.
<classifier>map-reduce</classifier>
<version>${project.version}</version>
</dependency>
-
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-core</artifactId>
<version>${accumulo.version}</version>
</dependency>
-
<dependency>
<groupId>org.apache.rya</groupId>
<artifactId>sesame-runtime-osgi</artifactId>
@@ -436,7 +434,7 @@ under the License.
</dependency>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
- <artifactId>geomesa-distributed-runtime</artifactId>
+ <artifactId>geomesa-accumulo-distributed-runtime</artifactId>
<version>${geomesa.version}</version>
</dependency>
[3/3] incubator-rya git commit: Merge branch 'geomesa_version_bump'
of https://github.com/mpfaffenberger/incubator-rya into develop
Posted by mi...@apache.org.
Merge branch 'geomesa_version_bump' of https://github.com/mpfaffenberger/incubator-rya into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/1a383960
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/1a383960
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/1a383960
Branch: refs/heads/develop
Commit: 1a3839607d61be7ddd0124f6e50f7c0ae35367c8
Parents: 8db5bbc 6b29446
Author: Aaron Mihalik <mi...@alum.mit.edu>
Authored: Mon Feb 22 14:39:14 2016 -0500
Committer: Aaron Mihalik <mi...@alum.mit.edu>
Committed: Mon Feb 22 14:39:14 2016 -0500
----------------------------------------------------------------------
extras/indexingExample/pom.xml | 2 +-
extras/indexingExample/src/main/assembly/assembly.xml | 2 +-
pom.xml | 6 ++----
3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[2/3] incubator-rya git commit: RYA-41 Fixed a bug where
AccumuloIndexSet assumes the first node of a ParsedQuery is always a
Projection node.
Posted by mi...@apache.org.
RYA-41 Fixed a bug where AccumuloIndexSet assumes the first node of a ParsedQuery is always a Projection node.
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/8db5bbc3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/8db5bbc3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/8db5bbc3
Branch: refs/heads/develop
Commit: 8db5bbc3aa0256426c1c9ec925a31bf9e177ff3b
Parents: 3157bc4
Author: Kevin Chilton <ke...@localhost.localdomain>
Authored: Fri Feb 19 17:22:15 2016 -0500
Committer: Kevin Chilton <ke...@localhost.localdomain>
Committed: Fri Feb 19 17:22:15 2016 -0500
----------------------------------------------------------------------
.../external/tupleSet/AccumuloIndexSet.java | 9 ++-
.../external/tupleSet/ParsedQueryUtil.java | 60 ++++++++++++++++++
.../external/tupleSet/ParsedQueryUtilTest.java | 67 ++++++++++++++++++++
3 files changed, 135 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/8db5bbc3/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloIndexSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloIndexSet.java b/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloIndexSet.java
index 456c465..9c1bc7b 100644
--- a/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloIndexSet.java
+++ b/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloIndexSet.java
@@ -58,6 +58,7 @@ import org.openrdf.query.parser.sparql.SPARQLParser;
import org.openrdf.sail.SailException;
import com.google.common.base.Joiner;
+import com.google.common.base.Optional;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -123,7 +124,13 @@ public class AccumuloIndexSet extends ExternalTupleSet implements ExternalBatchi
this.accCon = accCon;
final SPARQLParser sp = new SPARQLParser();
final ParsedTupleQuery pq = (ParsedTupleQuery) sp.parseQuery(sparql, null);
- setProjectionExpr((Projection) pq.getTupleExpr());
+
+ Optional<Projection> projection = new ParsedQueryUtil().findProjection(pq);
+ if(!projection.isPresent()) {
+ throw new MalformedQueryException("SPARQL query '" + sparql + "' does not contain a Projection.");
+ }
+ setProjectionExpr(projection.get());
+
Set<VariableOrder> orders = null;
try {
orders = pcj.getPcjMetadata(accCon, tablename).getVarOrders();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/8db5bbc3/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtil.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtil.java b/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtil.java
new file mode 100644
index 0000000..b41c9c9
--- /dev/null
+++ b/extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtil.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mvm.rya.indexing.external.tupleSet;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import org.openrdf.query.algebra.Projection;
+import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.openrdf.query.parser.ParsedQuery;
+
+import com.google.common.base.Optional;
+
+/**
+ * Utilities that help applications inspect {@link ParsedQuery} objects.
+ */
+@ParametersAreNonnullByDefault
+public class ParsedQueryUtil {
+
+ /**
+ * Finds the first {@link Projection} node within a {@link ParsedQuery}.
+ *
+ * @param query - The query that will be searched. (not null)
+ * @return The first projection encountered if the query has one; otherwise absent.
+ */
+ public Optional<Projection> findProjection(final ParsedQuery query) {
+ checkNotNull(query);
+
+ // When a projection is encountered for the requested index, store it in atomic reference and quit searching.
+ final AtomicReference<Projection> projectionRef = new AtomicReference<>();
+
+ query.getTupleExpr().visit(new QueryModelVisitorBase<RuntimeException>() {
+ @Override
+ public void meet(Projection projection) {
+ projectionRef.set(projection);
+ }
+ });
+
+ return Optional.fromNullable( projectionRef.get() );
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/8db5bbc3/extras/indexing/src/test/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java b/extras/indexing/src/test/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
new file mode 100644
index 0000000..d3755b3
--- /dev/null
+++ b/extras/indexing/src/test/java/mvm/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mvm.rya.indexing.external.tupleSet;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openrdf.query.MalformedQueryException;
+import org.openrdf.query.algebra.Projection;
+import org.openrdf.query.parser.ParsedQuery;
+import org.openrdf.query.parser.sparql.SPARQLParser;
+
+import com.google.common.base.Optional;
+
+/**
+ * Tests the methods of {@link ParsedQueryUtil}.
+ */
+public class ParsedQueryUtilTest {
+
+ @Test
+ public void findProjection_distinctIsTopNode() throws MalformedQueryException {
+ // A SPARQL query that uses the DISTINCT keyword.
+ String sparql =
+ "SELECT DISTINCT ?a ?b " +
+ "WHERE {" +
+ "?a <http://talksTo> ?b" +
+ "}";
+
+ // Run the test.
+ SPARQLParser parser = new SPARQLParser();
+ ParsedQuery query = parser.parseQuery(sparql, null);
+ Optional<Projection> projection = new ParsedQueryUtil().findProjection(query);
+ assertTrue(projection.isPresent());
+ }
+
+ @Test
+ public void findProjection_projectionIsTopNode() throws MalformedQueryException {
+ // A SPARQL query that will result in the Projection node being the top node.
+ String sparql =
+ "SELECT ?a ?b " +
+ "WHERE {" +
+ "?a <http://talksTo> ?b" +
+ "}";
+
+ // Run the test.
+ SPARQLParser parser = new SPARQLParser();
+ ParsedQuery query = parser.parseQuery(sparql, null);
+ Optional<Projection> projection = new ParsedQueryUtil().findProjection(query);
+ assertTrue(projection.isPresent());
+ }
+}
\ No newline at end of file