somandal commented on code in PR #16002: URL: https://github.com/apache/pinot/pull/16002#discussion_r2165756966
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/geospatial/BaseH3IndexCreator.java: ########## @@ -104,12 +106,25 @@ public abstract class BaseH3IndexCreator implements GeoSpatialIndexCreator { @Override public Geometry deserialize(byte[] bytes) { - return GeometrySerializer.deserialize(bytes); + try { + return GeometrySerializer.deserialize(bytes); + } catch (Exception e) { + // For invalid serialized geometry, return null so that the doc can be skipped + return null; + } } @Override public void add(Geometry geometry) throws IOException { + if (geometry == null) { + ServerMetrics metrics = ServerMetrics.get(); + if (metrics != null) { + metrics.addMeteredGlobalValue(ServerMeter.INDEXING_FAILURES, 1); + } + _nextDocId++; + return; + } Preconditions.checkState(geometry instanceof Point, "H3 index can only be applied to Point, got: %s", Review Comment: done - have not added a log though (as that would flood logs) ########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/geospatial/BaseH3IndexCreator.java: ########## @@ -104,12 +106,25 @@ public abstract class BaseH3IndexCreator implements GeoSpatialIndexCreator { @Override public Geometry deserialize(byte[] bytes) { - return GeometrySerializer.deserialize(bytes); + try { + return GeometrySerializer.deserialize(bytes); + } catch (Exception e) { + // For invalid serialized geometry, return null so that the doc can be skipped + return null; + } } @Override public void add(Geometry geometry) Review Comment: done ########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/geospatial/BaseH3IndexCreator.java: ########## @@ -104,12 +106,25 @@ public abstract class BaseH3IndexCreator implements GeoSpatialIndexCreator { @Override public Geometry deserialize(byte[] bytes) { - return GeometrySerializer.deserialize(bytes); + try { + return GeometrySerializer.deserialize(bytes); + } catch (Exception e) { + // For invalid serialized geometry, return null so that the doc can be skipped + return null; + } } @Override public void add(Geometry geometry) throws IOException { + if (geometry == null) { + ServerMetrics metrics = ServerMetrics.get(); + if (metrics != null) { Review Comment: done -- 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