xiangfu0 opened a new pull request, #18680:
URL: https://github.com/apache/pinot/pull/18680

   ## Summary
   - skip flattened-doc-id to segment-doc-id translation when the JSON index 
mapping is identity
   - keep a direct doc-id bitmap path for realtime JSON index predicates whose 
JSON paths cannot expand through arrays
   - fall back to flattened-doc evaluation for array paths to preserve 
same-array-element semantics
   
   ## User Manual
   No table config changes are required. Existing JSON index configurations 
continue to work. Queries using JSON_MATCH or jsonExtractIndex can benefit 
automatically when a segment has one flattened JSON record per Pinot document, 
or in realtime segments when scalar/object JSON paths can be evaluated without 
array-element correlation.
   
   Sample table config snippet:
   ```json
   {
     "tableIndexConfig": {
       "jsonIndexConfigs": {
         "payload": {}
       }
     }
   }
   ```
   
   Sample queries:
   ```sql
   SELECT COUNT(*)
   FROM myTable
   WHERE JSON_MATCH(payload, '"$.eventType" = ''click''');
   
   SELECT jsonExtractIndex(payload, '$.eventType', 'STRING')
   FROM myTable
   WHERE JSON_MATCH(payload, '"$.country" = ''US''');
   ```
   
   Array predicates still use flattened-doc semantics:
   ```sql
   SELECT COUNT(*)
   FROM myTable
   WHERE JSON_MATCH(payload, '"$.items[*].sku" = ''abc'' AND "$.items[*].qty" > 
1');
   ```
   
   ## Tests
   - ./mvnw -pl pinot-segment-local -Dtest=JsonIndexTest test
   - ./mvnw spotless:apply -pl pinot-segment-local
   - ./mvnw checkstyle:check -pl pinot-segment-local
   - ./mvnw license:format -pl pinot-segment-local
   - ./mvnw license:check -pl pinot-segment-local
   - git diff --check


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