Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-dev] Unable to query with two attribute indexes in geomesa feature type

I tried with hard coded value, still getting same. Here is my query function

public void query(String queryStr, Integer limit, Integer offset, QueryListener ql) {

    SimpleFeatureIterator iterator = null;

    try{

      if(queryStr != null && !queryStr.isEmpty()){

        Query query = new Query(tableName, CQL.toFilter("di = 1"));

        if(limit != null && limit > 0)

          query.setMaxFeatures(limit);

        if(offset != null && offset > 0)

          query.setStartIndex(offset);

        iterator = sfs.getFeatures(query).features();

        while(iterator.hasNext()){

          ql.onFeature(iterator.next());

        }

      }

    }

    catch(Exception ex){

      ex.printStackTrace();

    }

    finally{

      if(iterator != null)

        iterator.close();

    }

  }


On Mon, May 1, 2017 at 7:17 PM, Emilio Lahr-Vivaz <elahrvivaz@xxxxxxxx> wrote:
So it's getting an empty query plan, which means that it couldn't extract any ranges from your filter. However, I can't reproduce the issue, either with 1.3.1 or current 1.3.2-SNAPSHOT master. I tried the following:

val sft = createSchema("r:Long:cardinality=high:index=join,*g:Point:srid=4326,di:Integer:index=join,al:Float,s:Float,b:Float,an:Float,he:Float,ve:Float,t:Float,m:Boolean,i:Boolean,ts:Long")
ds.getQueryPlan(new Query(sft.getTypeName, ECQL.toFilter("di = 1")), explainer = new ExplainPrintln)

It output what I would expect:

Planning 'AccumuloDataStoreTest3' di = 1
  Original filter: di = 1
  Hints: density[false] bin[false] stats[false] map-aggregate[false] sampling[none]
  Sort: none
  Transforms: None
  Strategy selection:
    Query processing took 2ms and produced 1 options
    Filter plan: FilterPlan[AttributeIndex[di = 1][None]]
    Strategy selection took 0ms for 1 options
  Strategy 1 of 1: AttributeIndex
    Strategy filter: AttributeIndex[di = 1][None]
    Plan: org.locationtech.geomesa.accumulo.index.JoinPlan
      Table: AccumuloDataStoreTest_attr_v4
      Deduplicate: false
      Column Families (1): List(I)
      Ranges (1): [%04;%00;%02;80000001%00;::%04;%00;%02;80000001%01;)
      Iterators (0):
      Join Plan: org.locationtech.geomesa.accumulo.index.BatchScanPlan
        Table: AccumuloDataStoreTest_records_v2
        Deduplicate: false
        Column Families (1): List(F)
        Ranges (0):
        Iterators (0):
    Plan creation took 11ms
  Query planning took 14ms

Can you provide the code your are using to create your query? Possibly something is subtly off there.

Thanks,

Emilio



On 05/01/2017 09:19 AM, Suresh Prajapati wrote:
Hi Emilio

Here is the log for query di = 1: 

[2017-05-01 18:47:54,120] TRACE Explainer: Planning 'aj_dev' di = 1

0 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  - Planning 'aj_dev' di = 1

[2017-05-01 18:47:54,124] TRACE Explainer:   Original filter: di = 1

4 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Original filter: di = 1

[2017-05-01 18:47:54,128] TRACE Explainer:   Hints: density[false] bin[false] stats[false] map-aggregate[false] sampling[none]

8 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Hints: density[false] bin[false] stats[false] map-aggregate[false] sampling[none]

[2017-05-01 18:47:54,131] TRACE Explainer:   Sort: none

11 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Sort: none

[2017-05-01 18:47:54,134] TRACE Explainer:   Transforms: None

14 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Transforms: None

[2017-05-01 18:47:54,135] TRACE Explainer:   Strategy selection:

15 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Strategy selection:

[2017-05-01 18:47:54,203] TRACE Explainer:     Query processing took 60ms and produced 1 options

83 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Query processing took 60ms and produced 1 options

[2017-05-01 18:47:54,210] TRACE Explainer:     Filter plan: FilterPlan[AttributeIndex[di = 1][None]]

90 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Filter plan: FilterPlan[AttributeIndex[di = 1][None]]

[2017-05-01 18:47:54,211] TRACE Explainer:     Strategy selection took 5ms for 1 options

91 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Strategy selection took 5ms for 1 options

[2017-05-01 18:47:54,212] TRACE Explainer:   Strategy 1 of 1: AttributeIndex

92 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Strategy 1 of 1: AttributeIndex

[2017-05-01 18:47:54,213] TRACE Explainer:     Strategy filter: AttributeIndex[di = 1][None]

93 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Strategy filter: AttributeIndex[di = 1][None]

[2017-05-01 18:47:54,235] TRACE Explainer:     Plan: org.locationtech.geomesa.accumulo.index.EmptyPlan

115 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Plan: org.locationtech.geomesa.accumulo.index.EmptyPlan

[2017-05-01 18:47:54,236] TRACE Explainer:       Table: 

116 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -       Table: 

[2017-05-01 18:47:54,238] TRACE Explainer:       Deduplicate: false

118 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -       Deduplicate: false

[2017-05-01 18:47:54,239] TRACE Explainer:       Column Families: all

119 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -       Column Families: all

[2017-05-01 18:47:54,241] TRACE Explainer:       Ranges (0): 

121 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -       Ranges (0): 

[2017-05-01 18:47:54,244] TRACE Explainer:       Iterators (0):

124 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -       Iterators (0):

[2017-05-01 18:47:54,246] TRACE Explainer:     Plan creation took 21ms

126 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -     Plan creation took 21ms

[2017-05-01 18:47:54,247] TRACE Explainer:   Query planning took 200ms

127 [Thread-5] TRACE org.locationtech.geomesa.index.utils.Explainer  -   Query planning took 200ms

Thank You

Suresh Prajapati


On Mon, May 1, 2017 at 6:37 PM, Emilio Lahr-Vivaz <elahrvivaz@xxxxxxxx> wrote:
Hi Suresh,

You can have more than one indexed attribute. Can you provide the explain logging for your query? That's usually the first place to look when a query isn't behaving like you expect.

Thanks,

Emilio


On 05/01/2017 08:09 AM, Suresh Prajapati wrote:
Hello Everyone

I am querying a geomesa feature which includes join index on two attributes(r and di). Query r=<int-value> runs and returns data for specified r value if any. However Query di=<int-value> doesn't finds any matching records though records for the same exists!

Here is my feature schema:

r:Long:cardinality=high:index=join,*g:Point:srid=4326,di:Integer:index=join,al:Float,s:Float,b:Float,an:Float,he:Float,ve:Float,t:Float,m:Boolean,i:Boolean,ts:Long;geomesa.table.sharing='true',geomesa.indices='attr:4:3,records:2:3,z2:3:3',geomesa.table.sharing.prefix='\\u0001'

I am not able to find out the root cause. Can't i have more than one attribute index in one schema?

Thank You

Suresh Prajapati

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

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


Back to the top