Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Bug found querying based on feature ID

Hi Beau,

That's great question.  There are two issues at hand:

1.  There's a tiny GeoTools filter serialization issue which I'm going to try and sort out.
2.  We haven't had a chance to wire up id queries to use our (new) records table. 

Once the GeoTools issue is sorted, we may have to switch over to GT version 12-SNAPSHOT to pull in the fixes.  Anyhow, all of that may take a few days to sort out.  The great news I'd mention is that you might not need to redeploy your Accumulo iterators. 

The one downside is that moving to GeoTools 12.x will likely require us to move to supporting GeoServer 2.6.x.  (GeoTools and GeoServer release together.)  Progress on this issue can be tracked at https://geomesa.atlassian.net/browse/GEOMESA-272.

Thanks again,

Jim

On 08/07/2014 01:36 PM, Beau Lalonde wrote:

Hi,

 

I am using a version of GeoMesa from the beginning of last week and I am mostly pleased with its performance.  I have, however, found a problem when I try to query based upon feature ID. 

 

I am able to successfully generate Filter objects based upon feature IDs and use those filter objects to modify and/or remove features within GeoMesa.  I cannot, however, use such feature ID filters to query GeoMesa without getting a CQLException.

 

Here is some abbreviated example Java code that illustrates the bug:

    String id1 = "ID1";

    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

    Filter filter = ff.id(Collections.singleton(ff.featureId(id1)));

    FeatureSource<SimpleFeatureType, SimpleFeature> featureSource = dataStore.getFeatureSource(featureName);

    Query query = new Query(featureName, filter);

    FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = featureSource.getFeatures(query);

    FeatureIterator<SimpleFeature> featureIterator = featureCollection.features(); // throws CQLException

 

Here’s the exception that’s thrown:

org.geotools.filter.text.cql2.CQLException: Encountered "IN ( ID1" at line 1, column 2.

Was expecting one of:

    "not" ...

    "include" ...

    "exclude" ...

    "(" ...

    "[" ...

    "id" ...

    "in" ...

    <IDENTIFIER> ...

    <DATE> ...

    <DATE_TIME> ...

    "-" ...

    <INTEGER_LITERAL> ...

    <FLOATING_LITERAL> ...

    <STRING_LITERAL> ...

    "true" ...

    "false" ...

    "point" ...

    "linestring" ...

    "polygon" ...

    "multipoint" ...

    "multilinestring" ...

    "multipolygon" ...

    "geometrycollection" ...

    "envelope" ...

    "in" "(" <STRING_LITERAL> ...

    "in" "(" <INTEGER_LITERAL> ...

     Parsing : (IN (ID1)).

                at org.geotools.filter.text.ecql.ECQLCompiler.compileFilter(ECQLCompiler.java:102)

                at org.geotools.filter.text.commons.CompilerUtil.parseFilter(CompilerUtil.java:196)

                at org.geotools.filter.text.ecql.ECQL.toFilter(ECQL.java:120)

                at org.geotools.filter.text.ecql.ECQL.toFilter(ECQL.java:99)

                at geomesa.core.iterators.IteratorTrigger$.getFilterAttributes(IteratorTrigger.scala:114)

                at geomesa.core.iterators.IteratorTrigger$.passThroughFilter(IteratorTrigger.scala:109)

                at geomesa.core.iterators.IteratorTrigger$$anonfun$8.apply(IteratorTrigger.scala:70)

                at geomesa.core.iterators.IteratorTrigger$$anonfun$8.apply(IteratorTrigger.scala:70)

                at scala.Option.map(Option.scala:145)

                at geomesa.core.iterators.IteratorTrigger$.useIndexOnlyIterator(IteratorTrigger.scala:70)

                at geomesa.core.iterators.IteratorTrigger$.chooseIterator(IteratorTrigger.scala:52)

                at geomesa.core.index.IndexQueryPlanner.stIdxQuery(IndexQueryPlanner.scala:373)

                at geomesa.core.index.IndexQueryPlanner.runAttrIdxQuery(IndexQueryPlanner.scala:164)

                at geomesa.core.index.IndexQueryPlanner.geomesa$core$index$IndexQueryPlanner$$runQuery(IndexQueryPlanner.scala:135)

                at geomesa.core.index.IndexQueryPlanner$$anonfun$getIterator$1.apply(IndexQueryPlanner.scala:94)

                at geomesa.core.index.IndexQueryPlanner$$anonfun$getIterator$1.apply(IndexQueryPlanner.scala:94)

                at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)

                at geomesa.core.util.CloseableIterator$$anon$3.hasNext(CloseableIterator.scala:20)

                at geomesa.core.iterators.DeDuplicatingIterator.findTop(DeDuplicatingIterator.scala:51)

                at geomesa.core.iterators.DeDuplicatingIterator.<init>(DeDuplicatingIterator.scala:58)

                at geomesa.core.index.IndexSchema.adaptIterator(IndexSchema.scala:117)

                at geomesa.core.index.IndexSchema.query(IndexSchema.scala:102)

                at geomesa.core.data.AccumuloFeatureReader.<init>(AccumuloFeatureReader.scala:32)

                at geomesa.core.data.AccumuloDataStore.getFeatureReader(AccumuloDataStore.scala:751)

                at geomesa.core.data.AccumuloDataStore.getFeatureReader(AccumuloDataStore.scala:60)

                at org.geotools.data.AbstractDataStore.getFeatureReader(AbstractDataStore.java:369)

                at org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:215)

                at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:231)

                at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:199)

                at org.geotools.data.store.DataFeatureCollection.features(DataFeatureCollection.java:188)

                at org.geotools.data.store.DataFeatureCollection.features(DataFeatureCollection.java:79)

 

Is there a safe way to query based on feature ID?  Has this bug already been fixed?

 

Thanks,

Beau

 



_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users


Back to the top