hugabora opened a new issue, #13384:
URL: https://github.com/apache/druid/issues/13384

   Multivalue equality filter with literal returns wrong value for mv column in 
SQL due to assuming transitivity wrongly
   
   ### Affected Version
   
   24.0.0
   
   ### Description
   
   SQL query rewrite to native query uses transitivity logic on multi value 
columns, and results in selecting the virtual column instead of the original 
expression
   
   Example SQL:
   ```sql
   SELECT id
        , mv_col
     FROM results_b
     WHERE mv_col='one_value'
   ```
   
   in the json native query, a virtual column is created w the literal value 
and that is used in the columns
   ```json
      ...
     "virtualColumns": [
           {
               "type": "expression",
               "name": "v0",
               "expression": "'one_value'",
               "outputType": "STRING"
           }
       ],
       ...
       "columns": [
           "id",
           "v0"
       ],
       ...
   ```
   
   There is no need for the virtual column and the original column should be in 
the columns:
   ```json
       ...
       "columns": [
           "id",
           "mv_col"
       ],
       ...
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to