You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "robo220 (via GitHub)" <gi...@apache.org> on 2023/04/24 09:42:31 UTC
[GitHub] [druid] robo220 opened a new pull request, #14149: fix(avro-json-path-expressions): allow more complex jsonpath expressions
robo220 opened a new pull request, #14149:
URL: https://github.com/apache/druid/pull/14149
provide the jayway json path library with a type is can understand.
### Description
When using the avro extension druid does not ingest dimensions that have been flattened using the below jsonpath expression
```
someRecordArray[?(@.nestedString=='string in record')].nestedString
```
The purpose of the above expression is to capture all elements within a record array which have their `nestedString` field set to 'string in record'. This was not working in druid because the jayway jsonpath library was throwing an exception with the message `com.jayway.jsonpath.JsonPathException: Could not convert string in record to a ValueNode`. Exceptions are suppressed for this library so end users would not see this error appear in the logs (I believe).
The expection would have been thrown here https://github.com/json-path/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/internal/filter/ValueNodes.java#L705 This is because the `res` is of type `org.apache.avro.util.Utf8`. The idea with my fix is to return a type which the jayway json path can understand.
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [ x ] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ x ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [ x ] been tested in a test Druid cluster.
--
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@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] cryptoe merged pull request #14149: fix(avro-json-path-expressions): allow more complex jsonpath expressions
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe merged PR #14149:
URL: https://github.com/apache/druid/pull/14149
--
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@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] cryptoe commented on pull request #14149: fix(avro-json-path-expressions): allow more complex jsonpath expressions
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on PR #14149:
URL: https://github.com/apache/druid/pull/14149#issuecomment-1523090320
@robo220 Thank you for your contribution. Looking forward to many more!!.
--
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@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org