Jackie-Jiang commented on code in PR #18834:
URL: https://github.com/apache/pinot/pull/18834#discussion_r3456191546


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/inv/geospatial/OffHeapH3IndexCreator.java:
##########
@@ -73,7 +73,9 @@ public OffHeapH3IndexCreator(File indexDir, String 
columnName, String tableNameW
   public void add(@Nullable Geometry geometry)
       throws IOException {
     super.add(geometry);
-    if (_postingListMap.size() % FLUSH_THRESHOLD == 0) {
+    // Skip flushing an empty posting list map. This could happen when add() 
didn't add any entry due to invalid
+    // Geometry and _continueOnError is set
+    if (!_postingListMap.isEmpty() && _postingListMap.size() % FLUSH_THRESHOLD 
== 0) {

Review Comment:
   Should we simply do:
   ```suggestion
       if (_postingListMap.size() == FLUSH_THRESHOLD) {
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to