kangkaisen opened a new pull request #251: Fix InsertStmt reAnalyze bug
URL: https://github.com/apache/incubator-doris/pull/251
 
 
   SQL1:
   ```
   insert into A
   select 
        cis_poi_id,
        cis_flag,
        cis_flag_id,
        dt,
        aor_id,
        aor_type,
        aor_id_last
   from (
         select dt,
                cis_flag,
                cis_poi_id,
                1 as cis_flag_id,
                aor_id,
                1 as aor_type,
                1 as aor_id_last
           from B
          where dt in (20180710, 20180711)
        ) t
   where t.dt=20180711 ;
   ```
   
   SQL2:
   ```
   insert into mart_waimai.dim_cis_poi_aor_change_d
   select 
        cis_poi_id,
        cis_flag,
        cis_flag_id,
        dt,
        aor_id,
        aor_type,
        aor_id_last
   from (
         select dt,
                cis_flag,
                cis_poi_id,
                1 as cis_flag_id,
                1 as aor_id,
                1 as aor_type,
                1 as aor_id_last
           from topic_contest_poi_info_dd
          where dt between 20180710 and 20180711
        ) t
   where t.dt=20180711 ;
   ```
   The only difference for SQL1 and SQL2 is InPredicate and BetweenPredicate. 
The SQL1 will success , but the SQL2 will failed.
   
   The cause is BetweenPredicate will Rewrite, but InsertStmt doesn't support 
rewrite.
   
   The InsertStmt should support rewrite and we should simplify the code logic 
in StmtExecutor.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to