tarun11Mavani commented on code in PR #19041:
URL: https://github.com/apache/pinot/pull/19041#discussion_r3797106189


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/openstruct/OpenStructColumnSplitter.java:
##########
@@ -201,7 +205,11 @@ private void addMap(@Nullable Map<String, Object> map) {
             ? keySpec.getDataType()
             : _inferredTypes.computeIfAbsent(key, k -> {
               DataType inferred = 
OpenStructTypeInference.inferDataType(rawValue);
-              return inferred != null ? inferred : DataType.STRING;
+              if (inferred == null) {
+                _inferenceFailuresPerKey.merge(key, 1L, Long::sum);
+                return DataType.STRING;
+              }
+              return inferred;
             });

Review Comment:
   Fixed — increment now runs on every fallback value 
(`_inferenceFailuresPerKey.merge(key, 1L, Long::sum)`), not just the first 
sighting. Also made type resolution sticky so a later unmappable value on an 
established key counts as a coercion failure, not a re-inference (this was
   throwing a `ClassCastException` before the fix). 
   The Map/List divergence is intentional and already covered by 
`OpenStructConsumingSealedParityTest`.



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