Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[geomesa-users] Geotools Join queries

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.


--
========= 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.



Back to the top