[ 
https://issues.apache.org/jira/browse/IGNITE-4238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15672334#comment-15672334
 ] 

Denis Magda commented on IGNITE-4238:
-------------------------------------

Added the example to "lgpl" section of the project. Here is the pull-request:
https://github.com/apache/ignite/pull/1241

[~avinogradov], please review that everything is properly done at Maven pom.xml 
layer. There is a chance that I missed something that is related to the fact 
that a binary version of {{ignite-spatial}} is not located in Maven Central and 
I have to add the GG remote repo URL to the pom if someone decides to run the 
example after downloading Apache Ignite binary and opening examples project.

[~sergi.vladykin], looks like that geospatial module is broken in the master. 
The example that I'm willing to merge works perfectly fine for version 1.7 and 
earliest but fails in the master with the exception below. Please have a look 
at the issue. This is the link to the same example that runs successfully on 
version 1.7 (https://github.com/apache/ignite/pull/1241/files).

{code}
[17:19:29,635][ERROR][main][GridMapQueryExecutor] Failed to execute local query.
class org.apache.ignite.IgniteCheckedException: Failed to execute SQL query.
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:929)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:981)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:956)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest0(GridMapQueryExecutor.java:567)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest(GridMapQueryExecutor.java:449)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onMessage(GridMapQueryExecutor.java:203)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor$1.applyx(GridReduceQueryExecutor.java:167)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor$1.applyx(GridReduceQueryExecutor.java:165)
        at 
org.apache.ignite.internal.util.lang.IgniteInClosure2X.apply(IgniteInClosure2X.java:38)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.send(IgniteH2Indexing.java:1836)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.send(GridReduceQueryExecutor.java:1184)
        at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:614)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$5.iterator(IgniteH2Indexing.java:1089)
        at 
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:81)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$6.iterator(IgniteH2Indexing.java:1127)
        at 
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:81)
        at 
org.apache.ignite.internal.processors.cache.QueryCursorImpl.getAll(QueryCursorImpl.java:100)
        at 
org.apache.ignite.examples.datagrid.SpatialQueryExample.main(SpatialQueryExample.java:65)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.h2.jdbc.JdbcSQLException: General error: 
"com.vividsolutions.jts.io.ParseException: Unknown geometry type: 
com.vividsolutions.jts.geom.Polygon (line 1)"; SQL statement:
SELECT
"SpatialQueryExample".MAPPOINT._KEY __C0,
"SpatialQueryExample".MAPPOINT._VAL __C1
FROM "SpatialQueryExample".MAPPOINT
WHERE INTERSECTS(COORDS, ?1) [50000-191]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.message.DbException.convert(DbException.java:295)
        at org.h2.value.ValueGeometry.get(ValueGeometry.java:105)
        at org.h2.value.Value.convertTo(Value.java:948)
        at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2SpatialIndex.getEnvelope(GridH2SpatialIndex.java:175)
        at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2SpatialIndex.findByGeometry(GridH2SpatialIndex.java:337)
        at org.h2.index.IndexCursor.find(IndexCursor.java:166)
        at org.h2.table.TableFilter.next(TableFilter.java:460)
        at org.h2.command.dml.Select.queryFlat(Select.java:541)
        at org.h2.command.dml.Select.queryWithoutCache(Select.java:654)
        at org.h2.command.dml.Query.query(Query.java:322)
        at org.h2.command.dml.Query.query(Query.java:309)
        at org.h2.command.dml.Query.query(Query.java:36)
        at org.h2.command.CommandContainer.query(CommandContainer.java:110)
        at org.h2.command.Command.executeQuery(Command.java:201)
        at 
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:110)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:922)
        ... 22 more
Caused by: com.vividsolutions.jts.io.ParseException: Unknown geometry type: 
com.vividsolutions.jts.geom.Polygon (line 1)
        at 
com.vividsolutions.jts.io.WKTReader.parseErrorWithLine(WKTReader.java:427)
        at 
com.vividsolutions.jts.io.WKTReader.readGeometryTaggedText(WKTReader.java:495)
        at com.vividsolutions.jts.io.WKTReader.read(WKTReader.java:205)
        at com.vividsolutions.jts.io.WKTReader.read(WKTReader.java:174)
        at org.h2.value.ValueGeometry.get(ValueGeometry.java:102)
        ... 36 more
{code}

> Example for spatial queries
> ---------------------------
>
>                 Key: IGNITE-4238
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4238
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Denis Magda
>            Assignee: Denis Magda
>            Priority: Blocker
>             Fix For: 1.8
>
>
> The geospatial example is missing in Apache examples. It makes sense to add 
> it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to