[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [geomesa-users] Geotools Join queries
|
Hi Dave,
We don't support joins through the query like that - joins against a
no-sql database tend to be very expensive. But we do have a few options.
If available, probably the best approach is to use our spark support and
do an in-memory join. If not, we also have a join WPS (web process
service) that you can use, but it limits the features from the first set
to 128:
https://github.com/locationtech/geomesa/blob/master/geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/process/JoinProcess.scala
If you want to use spark, I can try to find some examples for you.
Thanks,
Emilio
On 04/11/2017 06:05 PM, David Boyd wrote:
I have a feeling this is not supported but I would ask.
I have two featuretypes, with a common foreign_key between them.
I want to join on that foreign_key and retrieve columns/properties from
both featuretypes.
I found an example of this in the geotools documentation, but I can't
get it to work.
I simply can't find the name of the join column to retrieve.
Below is my code:
String propertynames[] = {
"\"GDELTArtifactRecordset.SourceFileName\"","\"GDELTArtifactRecordset.GlobalEventID\"","b.EventCode\""};
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
Filter jfilter =
ff.equals(ff.property("GDELTArtifactREcordset.GlobalEventID"),
ff.property("b.GlobalEventID"));
Query query = new Query("GDELTArtifactRecordset");
query.setPropertyNames(propertynames);
Join join = new Join("EventRecordset", jfilter);
join.setAlias("b");
query.getJoins().add(join);
query.setFilter(ff.greaterOrEqual(ff.property("GDELTArtifactRecordset.GlobalEventID"),
ff.literal(545650000)));
query.setStartIndex(0);
CachedRowSet rowset =
searchPersistor.search(query).getResults();
I have tried numerous various of the returned join column, but it will
no accept any column not in my GDELTArtifactRecordset.