ignite-2.0 - minor fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8a1ded1c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8a1ded1c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8a1ded1c Branch: refs/heads/ignite-5024 Commit: 8a1ded1cf55b9aaf1f60d2657ec3ebf1e14fa8bc Parents: f299671 Author: Sergi Vladykin <[email protected]> Authored: Mon Apr 24 10:43:03 2017 +0300 Committer: Sergi Vladykin <[email protected]> Committed: Mon Apr 24 10:43:03 2017 +0300 ---------------------------------------------------------------------- .../query/h2/opt/GridH2SpatialIndex.java | 24 +++++++++++++++----- .../query/h2/sql/GridQueryParsingTest.java | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/8a1ded1c/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java ---------------------------------------------------------------------- diff --git a/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java b/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java index c8f3f68..9389290 100644 --- a/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java +++ b/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java @@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.query.h2.opt; import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -29,13 +28,14 @@ import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; - -import org.apache.ignite.*; -import org.apache.ignite.internal.processors.query.h2.*; -import org.apache.ignite.internal.util.*; -import org.apache.ignite.internal.util.lang.*; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.processors.query.h2.H2Cursor; +import org.apache.ignite.internal.util.GridCursorIteratorWrapper; +import org.apache.ignite.internal.util.IgniteTree; +import org.apache.ignite.internal.util.lang.GridCursor; import org.h2.engine.Session; import org.h2.index.Cursor; +import org.h2.index.IndexLookupBatch; import org.h2.index.IndexType; import org.h2.index.SingleRowCursor; import org.h2.index.SpatialIndex; @@ -132,6 +132,18 @@ public class GridH2SpatialIndex extends GridH2IndexBase implements SpatialIndex ctx = tbl.rowDescriptor().context(); } + /** {@inheritDoc} */ + @Override public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) { + if (getTable().isPartitioned()) { + assert filter > 0; // Lookup batch will not be created for the first table filter. + + throw DbException.throwInternalError( + "Table with a spatial index must be the first in the query: " + getTable()); + } + + return null; // Support must be explicitly added. + } + /** * Check closed. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/8a1ded1c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java index 2085c9f..9782f28 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java @@ -506,7 +506,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest { // Schemas for index and table must match assertParseThrows("create index if not exists sch2.idx on sch1.Person (name)", - DbException.class, "Schema name must match [90080-194]"); + DbException.class, "Schema name must match [90080-195]"); assertParseThrows("create hash index if not exists idx on Person (name)", IgniteSQLException.class, "Only SPATIAL modifier is supported for CREATE INDEX");
