yangzhg opened a new issue #4314:
URL: https://github.com/apache/incubator-doris/issues/4314


   **Describe the bug**
   Predicate push down where sub query has distinct may throw NPE
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1.  create table like 
   ```
   +--------------+--------------+------+-------+---------+---------+
   | Field        | Type         | Null | Key   | Default | Extra   |
   +--------------+--------------+------+-------+---------+---------+
   | event_day    | DATETIME     | No   | true  | NULL    |         |
   | title        | VARCHAR(600) | No   | true  | NULL    |         |
   | report_value | VARCHAR(50)  | No   | false | NULL    | REPLACE |
   +--------------+--------------+------+-------+---------+---------+
   ```
   2. exec query 
   ```
   
   ```SELECT
       *
   FROM
       (
           SELECT
               DISTINCT event_day,
               title
           FROM
               click_show_window
       ) a
   WHERE
       a.title IS NOT NULL
   4. See error
   ```
   ERROR 1064 (HY000): errCode = 2, detailMessage = Unexpected exception: null
   ```
   
   this is because DISTINCT generate grouping exprs in agginfo, but this clause 
dosn`t have a group by clause
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to