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


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/MapFilterOperator.java:
##########
@@ -218,6 +226,54 @@ private BaseFilterOperator 
buildPerKeyFilterOperator(DataSource keyDs, QueryCont
     }
   }
 
+  @Nullable
+  private BaseFilterOperator trySparseJsonIndex(OpenStructDataSource osDs, 
DataSource sparseKeyDs,
+      QueryContext queryContext, int numDocs) {
+    JsonIndexReader jsonIndex = osDs.getSparseJsonIndex();
+    if (jsonIndex == null) {
+      return null;
+    }
+    if (sparseKeyDs.getDataSourceMetadata().getDataType().getStoredType() != 
FieldSpec.DataType.STRING) {

Review Comment:
   `addMap` coerces every value to the key's stored type before serializing, 
and for STRING that's `PinotDataType.STRING.convert` = 
`sourceType.toString(value)` — `Map` → `MapUtils.toString`, `List` → `OBJECT` 
fallthrough → `value.toString()`. 
   So the blob holds `{"k":"{\"a\":1}"}`, never `{"k":{"a":1}}`  and the index 
is built from that same text, so
   it has the matching top-level posting. `trySparseJsonIndex` also bails 
unless the stored type is STRING.
   
   Added `testNonScalarValuesStoredAsJsonStrings` to validate the same.



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