[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [geomesa-users] Geotools Join queries
|
When you've got time, definitely try out the Spark SQL support. It's efficient and quite flexible. And we need more people kicking the tires to make it robust.
> On Apr 11, 2017, at 6:20 PM, David Boyd <dboyd@xxxxxxxxxxxxxxxxx> wrote:
>
> Emilio:
>
> Thanks. That is what I thought. Yeah, such joins are very expensive.
>
> The plan was to eventually go to spark, but I don't think
> we have the schedule time. Well, brute force and ignorance to the rescue.
>
>
>> On 4/11/17 10:15 PM, Emilio Lahr-Vivaz wrote:
>> 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.
>>>
>>>
>>
>> _______________________________________________
>> geomesa-users mailing list
>> geomesa-users@xxxxxxxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.locationtech.org/mailman/listinfo/geomesa-users
>
> --
> ========= mailto:dboyd@xxxxxxxxxxxxxxxxx ============
> David W. Boyd
> VP, Data Solutions
> 10432 Balls Ford, Suite 240
> Manassas, VA 20109
> office: +1-703-552-2862
> cell: +1-703-402-7908
> ============== http://www.incadencecorp.com/ ============
> ISO/IEC JTC1 WG9, editor ISO/IEC 20547 Big Data Reference Architecture
> Chair ANSI/INCITS TC Big Data
> Co-chair NIST Big Data Public Working Group Reference Architecture
> First Robotic Mentor - FRC, FTC - www.iliterobotics.org
> Board Member- USSTEM Foundation - www.usstem.org
>
> The information contained in this message may be privileged
> and/or confidential and protected from disclosure.
> If the reader of this message is not the intended recipient
> or an employee or agent responsible for delivering this message
> to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication
> is strictly prohibited. If you have received this communication
> in error, please notify the sender immediately by replying to
> this message and deleting the material from any computer.
>
>
> _______________________________________________
> geomesa-users mailing list
> geomesa-users@xxxxxxxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.locationtech.org/mailman/listinfo/geomesa-users