You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "somu-imply (via GitHub)" <gi...@apache.org> on 2024/02/26 22:39:20 UTC
[PR] Adding null check to earliest and latest aggs (druid)
somu-imply opened a new pull request, #15972:
URL: https://github.com/apache/druid/pull/15972
I have been able to replicate this case in MSQ insert only, trying to add a test case. But overall the issue is this. When data is ingested using the following
```
insert into mytest
select
time_parse("time") as __time,
cityName
from table(
extern(
'{"type": "s3", "prefixes": ["s3://imply-eng-datasets/qa/IngestionTest/wikipedia/files/wikiticker-2015-09-12-sampled.json.gz"]}',
'{"type": "json"}',
'[{"name": "time", "type": "string"}, {"name": "channel", "type": "string"}, {"name": "cityName", "type": "string"}, {"name": "comment", "type": "string"}, {"name": "countryIsoCode", "type": "string"}, {"name": "countryName", "type": "string"}, {"name": "isAnonymous", "type": "string"}, {"name": "isMinor", "type": "string"}, {"name": "isNew", "type": "string"}, {"name": "isRobot", "type": "string"}, {"name": "isUnpatrolled", "type": "string"}, {"name": "metroCode", "type": "string"}, {"name": "namespace", "type": "string"}, {"name": "page", "type": "string"}, {"name": "regionIsoCode", "type": "string"}, {"name": "regionName", "type": "string"}, {"name": "user", "type": "string"}, {"name": "delta", "type": "long"}, {"name": "added", "type": "long"}, {"name": "deleted", "type": "long"}]'
)
)
where countryName in ('Japan')
partitioned by YEAR
clustered by __time
insert into mytest
select
time_parse("time") as __time,
added
from table(
extern(
'{"type": "s3", "prefixes": ["s3://imply-eng-datasets/qa/IngestionTest/wikipedia/files/wikiticker-2015-09-12-sampled.json.gz"]}',
'{"type": "json"}',
'[{"name": "time", "type": "string"}, {"name": "channel", "type": "string"}, {"name": "cityName", "type": "string"}, {"name": "comment", "type": "string"}, {"name": "countryIsoCode", "type": "string"}, {"name": "countryName", "type": "string"}, {"name": "isAnonymous", "type": "string"}, {"name": "isMinor", "type": "string"}, {"name": "isNew", "type": "string"}, {"name": "isRobot", "type": "string"}, {"name": "isUnpatrolled", "type": "string"}, {"name": "metroCode", "type": "string"}, {"name": "namespace", "type": "string"}, {"name": "page", "type": "string"}, {"name": "regionIsoCode", "type": "string"}, {"name": "regionName", "type": "string"}, {"name": "user", "type": "string"}, {"name": "delta", "type": "long"}, {"name": "added", "type": "long"}, {"name": "deleted", "type": "long"}]'
)
)
where countryName in ('Japan')
partitioned by YEAR
clustered by __time
```
Running a query like this below would throw an NPE.
```
select earliest(added) from mytest
Error: RUNTIME_FAILURE (OPERATOR)
Cannot read field "lhs" because "inPair" is null
java.lang.NullPointerException
```
We missed a null check in numeric earliest and latest aggs. After adding it back, these test cases pass

This PR has:
- [ ] 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.
- [ ] 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.
- [ ] 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
Re: [PR] Adding null check to earliest and latest aggs (druid)
Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on PR #15972:
URL: https://github.com/apache/druid/pull/15972#issuecomment-1978009371
Can we add a test reproducing the issue? When is the `inPair` null?
--
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
Re: [PR] Adding null check to earliest and latest aggs (druid)
Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla merged PR #15972:
URL: https://github.com/apache/druid/pull/15972
--
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
Re: [PR] Adding null check to earliest and latest aggs (druid)
Posted by "somu-imply (via GitHub)" <gi...@apache.org>.
somu-imply commented on PR #15972:
URL: https://github.com/apache/druid/pull/15972#issuecomment-1979624142
I have added a testcase with nulls to replicate the issue. Before the change the added test case would throw a NPE, which is now avoided
--
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