{"action":"created","comment":{"url":"https://api.github.com/repos/locationtech/geomesa/pulls/comments/70337013","id":70337013,"diff_hunk":"@@ -0,0 +1,250 @@\n+/***********************************************************************\n+* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.\n+* All rights reserved. This program and the accompanying materials\n+* are made available under the terms of the Apache License, Version 2.0\n+* which accompanies this distribution and is available at\n+* http://www.opensource.org/licenses/apache2.0.php.\n+*************************************************************************/\n+\n+package org.locationtech.geomesa.accumulo.process\n+\n+import com.typesafe.scalalogging.LazyLogging\n+import org.geotools.data.simple.{SimpleFeatureCollection, SimpleFeatureIterator}\n+import org.geotools.data.store.ReTypingFeatureCollection\n+import org.geotools.feature.collection.DecoratingSimpleFeatureCollection\n+import org.geotools.feature.simple.SimpleFeatureTypeBuilder\n+import org.geotools.feature.{AttributeTypeBuilder, DefaultFeatureCollection}\n+import org.geotools.process.ProcessException\n+import org.geotools.process.factory.{DescribeParameter, DescribeProcess, DescribeResult}\n+import org.geotools.process.vector.VectorProcess\n+import org.geotools.util.NullProgressListener\n+import org.locationtech.geomesa.accumulo.process.query.{QueryResult, QueryVisitor}\n+import org.locationtech.geomesa.accumulo.util.SelfClosingIterator\n+import org.locationtech.geomesa.features.ScalaSimpleFeature\n+import org.locationtech.geomesa.filter.function.BinaryOutputEncoder\n+import org.locationtech.geomesa.filter.function.BinaryOutputEncoder.EncodingOptions\n+import org.opengis.feature.simple.{SimpleFeature, SimpleFeatureType}\n+import org.opengis.filter.Filter\n+import org.opengis.util.ProgressListener\n+\n+/**\n+  * Returns features from a feature type based on a join against a second feature type.\n+  */\n+@DescribeProcess(\n+  title = \"Join Process\",\n+  description = \"Queries a feature type based on attributes from a second feature type\"\n+)\n+class JoinProcess extends VectorProcess with LazyLogging {\n+\n+  /**\n+    *\n+    * @param primary main feature collection to query\n+    * @param secondary secondary feature collection to query with results from first feature collection\n+    * @param joinAttribute attribute to join on\n+    * @param joinFilter additional filter to apply to joined features\n+    * @param attributes attributes to return, from both collections, qualified by schema name\n+    * @param bins flag to return results in BIN format\n+    * @param binDtg date field for bin records - will use default date if not specified\n+    * @param binTrackId track ID field for bin records - will not include trackId if not specified\n+    * @param binLabel label field for bin record (optional)\n+    * @param monitor listener to monitor progress\n+    * @throws org.geotools.process.ProcessException if something goes wrong\n+    * @return\n+    */\n+  @throws(classOf[ProcessException])\n+  @DescribeResult(name = \"result\", description = \"Output features\")\n+  def execute(@DescribeParameter(name = \"primary\", description = \"Primary feature collection being queried\", min = 1)\n+              primary: SimpleFeatureCollection,\n+              @DescribeParameter(name = \"secondary\", description = \"Secondary feature collection to be joined\", min = 1)\n+              secondary: SimpleFeatureCollection,\n+              @DescribeParameter(name = \"joinAttribute\", description = \"Attribute field to join on\", min = 1)\n+              joinAttribute: String,\n+              @DescribeParameter(name = \"joinFilter\", description = \"Additional filter to apply to joined features\", min = 0)\n+              joinFilter: Filter,\n+              @DescribeParameter(name = \"attributes\", description = \"Attributes to return. Attribute names should be qualified with the schema name, e.g. foo.bar\", min = 0, max = 128, collectionType = classOf[String])\n+              attributes: java.util.List[String],\n+              @DescribeParameter(name = \"bins\", description = \"Return BIN records instead of regular records\", min = 0)\n+              bins: java.lang.Boolean,\n+              @DescribeParameter(name = \"binDtg\", description = \"Date field to use for BIN records\", min = 0)\n+              binDtg: String,\n+              @DescribeParameter(name = \"binTrackId\", description = \"Track field to use for BIN records\", min = 0)\n+              binTrackId: String,\n+              @DescribeParameter(name = \"binLabel\", description = \"Label field to use for BIN records\", min = 0)\n+              binLabel: String,\n+              monitor: ProgressListener): SimpleFeatureCollection = {\n+\n+    import org.locationtech.geomesa.filter.ff\n+\n+    import scala.collection.JavaConversions._\n+\n+    logger.trace(s\"Attempting join query on ${joinAttribute.getClass.getName}\")\n+\n+    if (primary.isInstanceOf[ReTypingFeatureCollection] || secondary.isInstanceOf[ReTypingFeatureCollection]) {","path":"geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/process/JoinProcess.scala","position":82,"original_position":82,"commit_id":"f1fb2febc1e0273a131e0d7dc2762f1e7757d864","original_commit_id":"f1fb2febc1e0273a131e0d7dc2762f1e7757d864","user":{"login":"elahrvivaz","id":7715322,"avatar_url":"https://avatars.githubusercontent.com/u/7715322?v=3","gravatar_id":"","url":"https://api.github.com/users/elahrvivaz","html_url":"https://github.com/elahrvivaz","followers_url":"https://api.github.com/users/elahrvivaz/followers","following_url":"https://api.github.com/users/elahrvivaz/following{/other_user}","gists_url":"https://api.github.com/users/elahrvivaz/gists{/gist_id}","starred_url":"https://api.github.com/users/elahrvivaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elahrvivaz/subscriptions","organizations_url":"https://api.github.com/users/elahrvivaz/orgs","repos_url":"https://api.github.com/users/elahrvivaz/repos","events_url":"https://api.github.com/users/elahrvivaz/events{/privacy}","received_events_url":"https://api.github.com/users/elahrvivaz/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2016-07-11T21:05:19Z","updated_at":"2016-07-11T21:05:19Z","html_url":"https://github.com/locationtech/geomesa/pull/969#discussion_r70337013","pull_request_url":"https://api.github.com/repos/locationtech/geomesa/pulls/969","_links":{"self":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/comments/70337013"},"html":{"href":"https://github.com/locationtech/geomesa/pull/969#discussion_r70337013"},"pull_request":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/969"}}},"pull_request":{"url":"https://api.github.com/repos/locationtech/geomesa/pulls/969","id":75865761,"html_url":"https://github.com/locationtech/geomesa/pull/969","diff_url":"https://github.com/locationtech/geomesa/pull/969.diff","patch_url":"https://github.com/locationtech/geomesa/pull/969.patch","issue_url":"https://api.github.com/repos/locationtech/geomesa/issues/969","number":969,"state":"open","locked":false,"title":"GEOMESA-1256 WPS join process for querying two different schemas","user":{"login":"elahrvivaz","id":7715322,"avatar_url":"https://avatars.githubusercontent.com/u/7715322?v=3","gravatar_id":"","url":"https://api.github.com/users/elahrvivaz","html_url":"https://github.com/elahrvivaz","followers_url":"https://api.github.com/users/elahrvivaz/followers","following_url":"https://api.github.com/users/elahrvivaz/following{/other_user}","gists_url":"https://api.github.com/users/elahrvivaz/gists{/gist_id}","starred_url":"https://api.github.com/users/elahrvivaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elahrvivaz/subscriptions","organizations_url":"https://api.github.com/users/elahrvivaz/orgs","repos_url":"https://api.github.com/users/elahrvivaz/repos","events_url":"https://api.github.com/users/elahrvivaz/events{/privacy}","received_events_url":"https://api.github.com/users/elahrvivaz/received_events","type":"User","site_admin":false},"body":"I rebased on master and it wouldn't let me re-open the old PR, so this replaces #961 \r\n\r\nSigned-off-by: Emilio Lahr-Vivaz <elahrvivaz@ccri.com>","created_at":"2016-06-30T18:15:39Z","updated_at":"2016-07-11T21:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"baf184eabae089d6a3f7e95d5cfb1b112d6a67d4","assignee":{"login":"jahhulbert-ccri","id":7433591,"avatar_url":"https://avatars.githubusercontent.com/u/7433591?v=3","gravatar_id":"","url":"https://api.github.com/users/jahhulbert-ccri","html_url":"https://github.com/jahhulbert-ccri","followers_url":"https://api.github.com/users/jahhulbert-ccri/followers","following_url":"https://api.github.com/users/jahhulbert-ccri/following{/other_user}","gists_url":"https://api.github.com/users/jahhulbert-ccri/gists{/gist_id}","starred_url":"https://api.github.com/users/jahhulbert-ccri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahhulbert-ccri/subscriptions","organizations_url":"https://api.github.com/users/jahhulbert-ccri/orgs","repos_url":"https://api.github.com/users/jahhulbert-ccri/repos","events_url":"https://api.github.com/users/jahhulbert-ccri/events{/privacy}","received_events_url":"https://api.github.com/users/jahhulbert-ccri/received_events","type":"User","site_admin":false},"assignees":[{"login":"jahhulbert-ccri","id":7433591,"avatar_url":"https://avatars.githubusercontent.com/u/7433591?v=3","gravatar_id":"","url":"https://api.github.com/users/jahhulbert-ccri","html_url":"https://github.com/jahhulbert-ccri","followers_url":"https://api.github.com/users/jahhulbert-ccri/followers","following_url":"https://api.github.com/users/jahhulbert-ccri/following{/other_user}","gists_url":"https://api.github.com/users/jahhulbert-ccri/gists{/gist_id}","starred_url":"https://api.github.com/users/jahhulbert-ccri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahhulbert-ccri/subscriptions","organizations_url":"https://api.github.com/users/jahhulbert-ccri/orgs","repos_url":"https://api.github.com/users/jahhulbert-ccri/repos","events_url":"https://api.github.com/users/jahhulbert-ccri/events{/privacy}","received_events_url":"https://api.github.com/users/jahhulbert-ccri/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/locationtech/geomesa/pulls/969/commits","review_comments_url":"https://api.github.com/repos/locationtech/geomesa/pulls/969/comments","review_comment_url":"https://api.github.com/repos/locationtech/geomesa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/locationtech/geomesa/issues/969/comments","statuses_url":"https://api.github.com/repos/locationtech/geomesa/statuses/f1fb2febc1e0273a131e0d7dc2762f1e7757d864","head":{"label":"elahrvivaz:fcr_wps_join","ref":"fcr_wps_join","sha":"f1fb2febc1e0273a131e0d7dc2762f1e7757d864","user":{"login":"elahrvivaz","id":7715322,"avatar_url":"https://avatars.githubusercontent.com/u/7715322?v=3","gravatar_id":"","url":"https://api.github.com/users/elahrvivaz","html_url":"https://github.com/elahrvivaz","followers_url":"https://api.github.com/users/elahrvivaz/followers","following_url":"https://api.github.com/users/elahrvivaz/following{/other_user}","gists_url":"https://api.github.com/users/elahrvivaz/gists{/gist_id}","starred_url":"https://api.github.com/users/elahrvivaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elahrvivaz/subscriptions","organizations_url":"https://api.github.com/users/elahrvivaz/orgs","repos_url":"https://api.github.com/users/elahrvivaz/repos","events_url":"https://api.github.com/users/elahrvivaz/events{/privacy}","received_events_url":"https://api.github.com/users/elahrvivaz/received_events","type":"User","site_admin":false},"repo":{"id":20541167,"name":"geomesa","full_name":"elahrvivaz/geomesa","owner":{"login":"elahrvivaz","id":7715322,"avatar_url":"https://avatars.githubusercontent.com/u/7715322?v=3","gravatar_id":"","url":"https://api.github.com/users/elahrvivaz","html_url":"https://github.com/elahrvivaz","followers_url":"https://api.github.com/users/elahrvivaz/followers","following_url":"https://api.github.com/users/elahrvivaz/following{/other_user}","gists_url":"https://api.github.com/users/elahrvivaz/gists{/gist_id}","starred_url":"https://api.github.com/users/elahrvivaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elahrvivaz/subscriptions","organizations_url":"https://api.github.com/users/elahrvivaz/orgs","repos_url":"https://api.github.com/users/elahrvivaz/repos","events_url":"https://api.github.com/users/elahrvivaz/events{/privacy}","received_events_url":"https://api.github.com/users/elahrvivaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/elahrvivaz/geomesa","description":"","fork":true,"url":"https://api.github.com/repos/elahrvivaz/geomesa","forks_url":"https://api.github.com/repos/elahrvivaz/geomesa/forks","keys_url":"https://api.github.com/repos/elahrvivaz/geomesa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elahrvivaz/geomesa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elahrvivaz/geomesa/teams","hooks_url":"https://api.github.com/repos/elahrvivaz/geomesa/hooks","issue_events_url":"https://api.github.com/repos/elahrvivaz/geomesa/issues/events{/number}","events_url":"https://api.github.com/repos/elahrvivaz/geomesa/events","assignees_url":"https://api.github.com/repos/elahrvivaz/geomesa/assignees{/user}","branches_url":"https://api.github.com/repos/elahrvivaz/geomesa/branches{/branch}","tags_url":"https://api.github.com/repos/elahrvivaz/geomesa/tags","blobs_url":"https://api.github.com/repos/elahrvivaz/geomesa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elahrvivaz/geomesa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elahrvivaz/geomesa/git/refs{/sha}","trees_url":"https://api.github.com/repos/elahrvivaz/geomesa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elahrvivaz/geomesa/statuses/{sha}","languages_url":"https://api.github.com/repos/elahrvivaz/geomesa/languages","stargazers_url":"https://api.github.com/repos/elahrvivaz/geomesa/stargazers","contributors_url":"https://api.github.com/repos/elahrvivaz/geomesa/contributors","subscribers_url":"https://api.github.com/repos/elahrvivaz/geomesa/subscribers","subscription_url":"https://api.github.com/repos/elahrvivaz/geomesa/subscription","commits_url":"https://api.github.com/repos/elahrvivaz/geomesa/commits{/sha}","git_commits_url":"https://api.github.com/repos/elahrvivaz/geomesa/git/commits{/sha}","comments_url":"https://api.github.com/repos/elahrvivaz/geomesa/comments{/number}","issue_comment_url":"https://api.github.com/repos/elahrvivaz/geomesa/issues/comments{/number}","contents_url":"https://api.github.com/repos/elahrvivaz/geomesa/contents/{+path}","compare_url":"https://api.github.com/repos/elahrvivaz/geomesa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elahrvivaz/geomesa/merges","archive_url":"https://api.github.com/repos/elahrvivaz/geomesa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elahrvivaz/geomesa/downloads","issues_url":"https://api.github.com/repos/elahrvivaz/geomesa/issues{/number}","pulls_url":"https://api.github.com/repos/elahrvivaz/geomesa/pulls{/number}","milestones_url":"https://api.github.com/repos/elahrvivaz/geomesa/milestones{/number}","notifications_url":"https://api.github.com/repos/elahrvivaz/geomesa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elahrvivaz/geomesa/labels{/name}","releases_url":"https://api.github.com/repos/elahrvivaz/geomesa/releases{/id}","deployments_url":"https://api.github.com/repos/elahrvivaz/geomesa/deployments","created_at":"2014-06-05T20:51:54Z","updated_at":"2016-02-15T21:22:52Z","pushed_at":"2016-07-11T17:21:50Z","git_url":"git://github.com/elahrvivaz/geomesa.git","ssh_url":"git@github.com:elahrvivaz/geomesa.git","clone_url":"https://github.com/elahrvivaz/geomesa.git","svn_url":"https://github.com/elahrvivaz/geomesa","homepage":null,"size":33491,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"locationtech:master","ref":"master","sha":"5c943db9893f11f43a5602fc31a316ee37667cf7","user":{"login":"locationtech","id":1991411,"avatar_url":"https://avatars.githubusercontent.com/u/1991411?v=3","gravatar_id":"","url":"https://api.github.com/users/locationtech","html_url":"https://github.com/locationtech","followers_url":"https://api.github.com/users/locationtech/followers","following_url":"https://api.github.com/users/locationtech/following{/other_user}","gists_url":"https://api.github.com/users/locationtech/gists{/gist_id}","starred_url":"https://api.github.com/users/locationtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locationtech/subscriptions","organizations_url":"https://api.github.com/users/locationtech/orgs","repos_url":"https://api.github.com/users/locationtech/repos","events_url":"https://api.github.com/users/locationtech/events{/privacy}","received_events_url":"https://api.github.com/users/locationtech/received_events","type":"Organization","site_admin":false},"repo":{"id":13226069,"name":"geomesa","full_name":"locationtech/geomesa","owner":{"login":"locationtech","id":1991411,"avatar_url":"https://avatars.githubusercontent.com/u/1991411?v=3","gravatar_id":"","url":"https://api.github.com/users/locationtech","html_url":"https://github.com/locationtech","followers_url":"https://api.github.com/users/locationtech/followers","following_url":"https://api.github.com/users/locationtech/following{/other_user}","gists_url":"https://api.github.com/users/locationtech/gists{/gist_id}","starred_url":"https://api.github.com/users/locationtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locationtech/subscriptions","organizations_url":"https://api.github.com/users/locationtech/orgs","repos_url":"https://api.github.com/users/locationtech/repos","events_url":"https://api.github.com/users/locationtech/events{/privacy}","received_events_url":"https://api.github.com/users/locationtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/locationtech/geomesa","description":"GeoMesa is a suite of tools for working with big geo-spatial data in a distributed fashion.","fork":false,"url":"https://api.github.com/repos/locationtech/geomesa","forks_url":"https://api.github.com/repos/locationtech/geomesa/forks","keys_url":"https://api.github.com/repos/locationtech/geomesa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/locationtech/geomesa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/locationtech/geomesa/teams","hooks_url":"https://api.github.com/repos/locationtech/geomesa/hooks","issue_events_url":"https://api.github.com/repos/locationtech/geomesa/issues/events{/number}","events_url":"https://api.github.com/repos/locationtech/geomesa/events","assignees_url":"https://api.github.com/repos/locationtech/geomesa/assignees{/user}","branches_url":"https://api.github.com/repos/locationtech/geomesa/branches{/branch}","tags_url":"https://api.github.com/repos/locationtech/geomesa/tags","blobs_url":"https://api.github.com/repos/locationtech/geomesa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/locationtech/geomesa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/locationtech/geomesa/git/refs{/sha}","trees_url":"https://api.github.com/repos/locationtech/geomesa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/locationtech/geomesa/statuses/{sha}","languages_url":"https://api.github.com/repos/locationtech/geomesa/languages","stargazers_url":"https://api.github.com/repos/locationtech/geomesa/stargazers","contributors_url":"https://api.github.com/repos/locationtech/geomesa/contributors","subscribers_url":"https://api.github.com/repos/locationtech/geomesa/subscribers","subscription_url":"https://api.github.com/repos/locationtech/geomesa/subscription","commits_url":"https://api.github.com/repos/locationtech/geomesa/commits{/sha}","git_commits_url":"https://api.github.com/repos/locationtech/geomesa/git/commits{/sha}","comments_url":"https://api.github.com/repos/locationtech/geomesa/comments{/number}","issue_comment_url":"https://api.github.com/repos/locationtech/geomesa/issues/comments{/number}","contents_url":"https://api.github.com/repos/locationtech/geomesa/contents/{+path}","compare_url":"https://api.github.com/repos/locationtech/geomesa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/locationtech/geomesa/merges","archive_url":"https://api.github.com/repos/locationtech/geomesa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/locationtech/geomesa/downloads","issues_url":"https://api.github.com/repos/locationtech/geomesa/issues{/number}","pulls_url":"https://api.github.com/repos/locationtech/geomesa/pulls{/number}","milestones_url":"https://api.github.com/repos/locationtech/geomesa/milestones{/number}","notifications_url":"https://api.github.com/repos/locationtech/geomesa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/locationtech/geomesa/labels{/name}","releases_url":"https://api.github.com/repos/locationtech/geomesa/releases{/id}","deployments_url":"https://api.github.com/repos/locationtech/geomesa/deployments","created_at":"2013-09-30T20:13:46Z","updated_at":"2016-07-11T09:26:40Z","pushed_at":"2016-07-11T17:24:48Z","git_url":"git://github.com/locationtech/geomesa.git","ssh_url":"git@github.com:locationtech/geomesa.git","clone_url":"https://github.com/locationtech/geomesa.git","svn_url":"https://github.com/locationtech/geomesa","homepage":"https://www.locationtech.org/projects/technology.geomesa","size":45082,"stargazers_count":190,"watchers_count":190,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":16,"forks":95,"open_issues":16,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/969"},"html":{"href":"https://github.com/locationtech/geomesa/pull/969"},"issue":{"href":"https://api.github.com/repos/locationtech/geomesa/issues/969"},"comments":{"href":"https://api.github.com/repos/locationtech/geomesa/issues/969/comments"},"review_comments":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/969/comments"},"review_comment":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/locationtech/geomesa/pulls/969/commits"},"statuses":{"href":"https://api.github.com/repos/locationtech/geomesa/statuses/f1fb2febc1e0273a131e0d7dc2762f1e7757d864"}}}}
{"actor":{"display_login":"elahrvivaz"}}