somandal commented on code in PR #16002: URL: https://github.com/apache/pinot/pull/16002#discussion_r2139082669
########## 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); Review Comment: Can the `defaultNullValue` also be passed in? For some indexes like `LuceneTextIndexCreator` we probably want to add the `defaultNullValue` rather than skipping because the IndexReader takes the numDocs as input (and for this one it seems to fail if the numDocs don't match what we actually added). This strategy might not work for all scenarios though -- 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