[
https://issues.apache.org/jira/browse/CALCITE-6867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alessandro Solimando resolved CALCITE-6867.
-------------------------------------------
Resolution: Fixed
Fixed via
[0ff9fcf|https://github.com/apache/calcite/commit/0ff9fcf1e7763434b49aa215c071adcfe28ea097],
thanks [~xuzifu666] for your contribution and [~suibianwanwan33] for the
review and testing.
> Druid Adapter transforms an SQL NOT IN filter to a Druid IN filter
> ------------------------------------------------------------------
>
> Key: CALCITE-6867
> URL: https://issues.apache.org/jira/browse/CALCITE-6867
> Project: Calcite
> Issue Type: Bug
> Components: druid-adapter
> Affects Versions: 1.38.0
> Reporter: Yu Xu
> Assignee: Mihai Budiu
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.39.0
>
>
> Currently Druid Adapter would transform in / not in to In filter which is not
> correct, need to fix it.
> note:
> # Currently DruidJsonFilter##toInKindDruidFilter had filter only handle for
> two kind *SqlKind.DRUID_IN* and *SqlKind.DRUID_NOT_IN*
> # DruidJsonFilter##toInKindDruidFilter check for *SqlKind.IN* not
> *SqlKind.DRUID_NOT_IN* , would transform all to JsonInFilter include
> *SqlKind.DRUID_NOT_IN* , this is not fitable
> ut: DruidQueryFilterTest##testNotInFilter
> The newly added test fails as follows without the fix:
> {code:java}
> Expected: with toString()
> "{\"type\":\"not\",\"field\":{\"type\":\"in\",\"dimension\":\"dimensionName\",\"values\":[\"1\",\"5\",\"value1\"]}}"
> but: toString() was
> "{\"type\":\"in\",\"dimension\":\"dimensionName\",\"values\":[\"1\",\"5\",\"value1\"]}"
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)