[ 
https://issues.apache.org/jira/browse/CALCITE-6867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17931920#comment-17931920
 ] 

Yu Xu commented on CALCITE-6867:
--------------------------------

Hi [~asolimando] , in PR https://github.com/apache/calcite/pull/4218, Currently 
I had checked all case about DruidAdapterIT test, after test with docker env 
found no case had cover about SqlKind.DRUID_NOT_IN or SqlKind.DRUID_IN with 
test sql. IN would transform to OR with multiple EQUALS,
NOT IN would transform to AND with multiple multiple NOT_EQUALS, this cause 
cannot go through SqlKind.DRUID_NOT_IN or SqlKind.DRUID_IN. But the code with 
changed in PR is reasonable, could you give a plan or suggestion for next step 
or it be acceptable first?

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

Reply via email to