somandal commented on code in PR #16002:
URL: https://github.com/apache/pinot/pull/16002#discussion_r2178586213


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/geospatial/BaseH3IndexCreator.java:
##########
@@ -108,10 +114,19 @@ public Geometry deserialize(byte[] bytes) {
   }
 
   @Override
-  public void add(Geometry geometry)
+  public void add(@Nullable Geometry geometry)
       throws IOException {
-    Preconditions.checkState(geometry instanceof Point, "H3 index can only be 
applied to Point, got: %s",
-        geometry.getGeometryType());
+    if (geometry == null || !(geometry instanceof Point)) {
+      if (_tableNameWithType != null) {
+        String metricKeyName =
+            _tableNameWithType + "-" + 
H3IndexType.INDEX_DISPLAY_NAME.toUpperCase(Locale.US) + "-indexingError";
+        ServerMetrics.get().addMeteredTableValue(metricKeyName, 
ServerMeter.INDEXING_FAILURES, 1);
+      } else {

Review Comment:
   I've mostly added this due to cases where tableConfig might be null, etc:
   
   ```
         if (_tableConfig != null) {
           builder.withTableNameWithType(_tableConfig.getTableName());
         }
   ```



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

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


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

Reply via email to