You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/07/04 19:52:18 UTC

[GitHub] [incubator-pinot] kishoreg commented on a change in pull request #5654: [Part 1] Add geo support

kishoreg commented on a change in pull request #5654:
URL: https://github.com/apache/incubator-pinot/pull/5654#discussion_r449692895



##########
File path: pinot-core/pom.xml
##########
@@ -223,5 +230,17 @@
       <artifactId>lucene-analyzers-common</artifactId>
       <version>${lucene.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.openjdk.jmh</groupId>
+      <artifactId>jmh-core</artifactId>
+      <version>1.21</version>

Review comment:
       move version to pom.properties

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/StAsTextFunction.java
##########
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.geospatial.transform.function;

Review comment:
       function -> functions

##########
File path: pinot-tools/src/main/resources/examples/stream/meetupRsvp/meetupRsvp_schema.json
##########
@@ -37,6 +37,19 @@
     {
       "dataType": "STRING",
       "name": "group_name"
+    },
+    {
+      "dataType": "DOUBLE",
+      "name": "group_lat"
+    },
+    {
+      "dataType": "DOUBLE",
+      "name": "group_lon"
+    },
+    {
+      "dataType": "BYTES",
+      "name": "location",
+      "transformFunction": "stPoint(group_lon, group_lat)"

Review comment:
       Great to see this work

##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/streams/MeetupRsvpStream.java
##########
@@ -101,18 +107,18 @@ public void onMessage(String message) {
                     producer.produce("meetupRSVPEvents", extracted.toString().getBytes(StandardCharsets.UTF_8));
                   }
                 } catch (Exception e) {
-                  //LOGGER.error("error processing raw event ", e);
+                  LOGGER.error("error processing raw event ", e);
                 }
               }
             });
             session.getBasicRemote().sendText("");
           } catch (IOException e) {
-            //LOGGER.error("found an event where data did not have all the fields, don't care about for quickstart");
+            LOGGER.error("found an event where data did not have all the fields, don't care about for quickstart", e);
           }
         }
       }, cec, new URI("ws://stream.meetup.com/2/rsvps"));
     } catch (Exception e) {
-      //e.printStackTrace();
+      e.printStackTrace();

Review comment:
       logger?

##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/streams/MeetupRsvpStream.java
##########
@@ -87,11 +90,14 @@ public void onMessage(String message) {
                   }
 
                   JsonNode group = messageJSON.get("group");
+                  System.out.println(String.format("reading group %s", group.get("group_id")));
                   if (group != null) {
                     extracted.set("group_city", group.get("group_city"));
                     extracted.set("group_country", group.get("group_country"));
                     extracted.set("group_id", group.get("group_id"));
                     extracted.set("group_name", group.get("group_name"));
+                    extracted.set("group_lat", group.get("group_lat"));

Review comment:
       sweet

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/geospatial/transform/function/ConstructFromTextFunction.java
##########
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.geospatial.transform.function;
+
+import com.google.common.base.Preconditions;
+import org.apache.pinot.core.common.DataSource;
+import org.apache.pinot.core.geospatial.serde.GeometrySerializer;
+import org.apache.pinot.core.operator.blocks.ProjectionBlock;
+import org.apache.pinot.core.operator.transform.TransformResultMetadata;
+import org.apache.pinot.core.operator.transform.function.BaseTransformFunction;
+import org.apache.pinot.core.operator.transform.function.TransformFunction;
+import org.apache.pinot.core.plan.DocIdSetPlanNode;
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.geom.GeometryFactory;
+import org.locationtech.jts.io.ParseException;
+import org.locationtech.jts.io.WKTReader;
+
+import java.util.List;
+import java.util.Map;
+
+public abstract class ConstructFromTextFunction extends BaseTransformFunction {

Review comment:
       what does this function do? please add java docs




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org