You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "jackluo923 (via GitHub)" <gi...@apache.org> on 2023/03/01 09:09:20 UTC

[GitHub] [pinot] jackluo923 opened a new issue, #10360: JSON_MATCH filter ignores value type

jackluo923 opened a new issue, #10360:
URL: https://github.com/apache/pinot/issues/10360

   In the official Pinot documentation's JSON index [page](https://docs.pinot.apache.org/basics/indexing/json-index#value), the example hints that the boolean expression's right hand side can be either a STRING type (`'"<json path>"=''<string>'''`), INT type (`'"<json path>"=<int>'`) and FLOAT type (`'"<json path>":<float>'`). In reality, Pinot does not differentiate data type inside `JSON_MATCH` filter.
   
   Take the following table content as an example: 
   ```
   ----------------
   | JSON_COL      |
   ----------------
   | {"key": 1}    |
   ----------------
   | {"key": "1"}  |
   ----------------
   ```
   
   The following query would match **both** rows above: 
   ```
   SELECT * FROM TABLE WHERE CLP_MATCH("JSON_COL", '"$.key"=''1''')
   ```
   
   If the JSON_MATCH filter applies type-specific filter, then we only expect `{"key": "1"}` to be returned.
   
   **Is this a bug or a feature?** Can we expect this behavior to stay as-is for the foreseeable future? 


-- 
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-unsubscribe@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] jackluo923 commented on issue #10360: JSON_MATCH filter ignores value type

Posted by "jackluo923 (via GitHub)" <gi...@apache.org>.
jackluo923 commented on issue #10360:
URL: https://github.com/apache/pinot/issues/10360#issuecomment-1450750338

   Great! In our search workload, we do not know type of the tokens which we want to use in JSON_MATCH. Having JSON_MATCH that ignores the data type allow us to simplify our query thus working in our favor. 👍 


-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on issue #10360: JSON_MATCH filter ignores value type

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on issue #10360:
URL: https://github.com/apache/pinot/issues/10360#issuecomment-1450739176

   Good question. This behavior is due to how we store key-value pair in JSON index, where value is always appended without quotes.
   In order to change this, we can consider introducing a new JSON index version, where we put quotes over the value if it is a string.
   We will keep the current behavior for the current JSON index version for backward compatible


-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] jackluo923 closed issue #10360: JSON_MATCH filter ignores value type

Posted by "jackluo923 (via GitHub)" <gi...@apache.org>.
jackluo923 closed issue #10360: JSON_MATCH filter ignores value type
URL: https://github.com/apache/pinot/issues/10360


-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org