Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geowave-dev] No results with cqlfilter

Hi Marcel,

Thank you for your patience while we attempted to diagnose this issue.  We have confirmed the existence of a bug in which all but the last of the time ranges is being dropped for your particular use case.  We are working on the fix now and you may track the progress via https://github.com/ngageoint/geowave/issues/543.

Thanks again,
Derek

On Thu, Nov 5, 2015 at 9:42 AM, Marcel Jacob <m.jacob@xxxxxxxxxxx> wrote:
This is how I create my INDEX:
private static final Index INDEX = IndexType.SPATIAL_TEMPORAL_VECTOR.createDefaultIndex();

I made an upgrade to v0.9.0 and the problem is partially solved. At least I get some results. If I change my EventBaseCode to '020' I get 184 records.
Since I want to evaluate these kind of query, I imported my data also in PostGIS. The same query results in 860 records. So some records seems to disappear in GeoWave.
For value '018' it´s the same with 0 vs. 3 records. I wrote other temporal queries, which works fine. Performance is a second point, but at first I need the correct results.

Best regards,
Marcel Jacob.



Am 05.11.2015 15:01, schrieb Derek Yeager:
Hi Marcel,

Would you mind sharing how are you constructing the value of your "INDEX" parameter passed to the dataStore.query() method?  Nothing jumps out as incorrect, however I do notice that you are querying either a 2D spatial index or a 3D spatial-temporal index with a temporal-only query.  Our index strategies are designed to optimize spatial or spatial-temporal queries, so without the spatial component query performance may not be optimal.

As far as your second question, you are correct in that v0.8.9 only supports QueryOptions for getting a subset of attributes within certain query methods.  This has been addressed as part of a recent refactor of our data store interface and all queries will support attribute subsets as part of our next release.

Respectfully,
Derek

On Tue, Nov 3, 2015 at 8:22 AM, Marcel Jacob <m.jacob@xxxxxxxxxxx> wrote:
Hey Derek,
I´m sorry for the long response time. My EventBaseCode is a String.
Here is the query which causes the empty results:

/**
     * find events which are from type "empathic comment" (eventbasecode 018)
     * which took place during christmas (1979-2014).
     */
    private static Iterator<SimpleFeature> getResultsForQuery7(
            VectorDataStore dataStore,
            AccumuloAdapterStore adapterStore ) {

        Iterator<SimpleFeature> results = null;

        ArrayList<TemporalRange> christmasTemporalRangeList = new ArrayList<TemporalRange>();

        DateFormat df = new SimpleDateFormat(
                "yyyy-MM-dd");
        int year = 1979;
        do {
            try {
                Date start = df.parse(year + "-12-24");
                Date end = df.parse(year + "-12-26");
                TemporalRange temporalRange = new TemporalRange(
                        start,
                        end);
                christmasTemporalRangeList.add(temporalRange);
                year++;
            }
            catch (java.text.ParseException e) {
                e.printStackTrace();
            }
        }
        while (year < 2015);

        TemporalConstraints tempConstraints = new TemporalConstraints(
                christmasTemporalRangeList,
                "christmas");

        Filter eventFilter = null;
        try {
            eventFilter = CQL.toFilter("EventBaseCode = '018'");
        }
        catch (CQLException e) {
            e.printStackTrace();
        }

        FeatureDataAdapter adapter = (FeatureDataAdapter) adapterStore.getAdapter(new ByteArrayId(
                "geowave-gdelt"));

        TemporalQuery query = new TemporalQuery(
                tempConstraints);
       
        results = dataStore.query(
                adapter,
                INDEX,
                query,
                eventFilter,
                Integer.MAX_VALUE);

        return results;
    }

Do you see any problems in there? Another question: In some methods I can define queryOptions for getting only a subset of the attributes. What do I have to do when using
dataStore.query(adapter, INDEX, query, eventFilter, Integer.MAX_VALUE)? There is no queryOption parameter. Is it possible to express it via ECQL (similar to a select-statement in SQL)?

Best regards,
Marcel Jacob.



Am 29.10.2015 15:26, schrieb Derek Yeager:
Hi Marcel,

I would like to help you debug this issue.  Is the property "EventBaseCode" of type String or Integer?  You may find it easier to define your filter using the static CQL.toFilter() method.  For example:
  • CQL.toFilter("EventBaseCode = 18")  --> if EventBaseCode is an Integer
  • CQL.toFilter("EventBaseCode = '018'") --> if EventBaseCode is a String
The two query methods you are using are defined in different data store implementations (VectorDataStore vs. AccumuloDataStore) and follow different query paths under the covers in GeoWave.  I want to replicate the issue you are seeing so that I can properly debug it, but in order to do so I prefer to make as few assumptions as possible.  Would you mind sharing more code, the entire class if possible?

Thanks,
Derek

On Wed, Oct 28, 2015 at 1:11 PM, Marcel Jacob <m.jacob@xxxxxxxxxxx> wrote:
Hello,
I wrote a query which works fine with the following method:
datastore.query(INDEX, query, queryOptions);
When adding some cql-constraints the query also runs successfully using
the following method:
datastore.query(adapter, INDEX, query, eventFilter, Integer.MAX_VALUE);
But my result file is empty! I know that there have to be at least 3
results.
Version: 0.89-Snapshot.

Here is a code snippet for defining a filter and the adapter:

FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
         Filter eventFilter = ff.equal(
                 ff.property("EventBaseCode"),
                 ff.literal("018"),
                 false);

FeatureDataAdapter adapter = (FeatureDataAdapter)
adapterStore.getAdapter(new ByteArrayId(
                 "geowave-gdelt"));

The property "EventBaseCode" and my adapter "geowave-gdelt" exists.
What could be the problem?
Is there another method for executing a query using a cqlfilter?

Best regards,
Marcel Jacob.
_______________________________________________
geowave-dev mailing list
geowave-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/geowave-dev



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


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




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


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



Back to the top