WingsGo opened a new issue #3491: URL: https://github.com/apache/incubator-doris/issues/3491
**Describe the bug** The sql like `SELECT * FROM tbl WHERE olap_date='20200501` will not only scan partiiton `p20200501` but scan the full table, it is because `olap_date` is int type and `'20200501'` is string type, in following logic olap_date and string literal will convert to double and compare, which lead to a full table scan. https://github.com/apache/incubator-doris/blob/d64704599d338de290972c1324903cf03d7bab5c/fe/src/main/java/org/apache/doris/analysis/BinaryPredicate.java#L280-L310 Solutions: I think we should throw a DdlException when compare string literal to a numerical type to avoid this situation, Is there any solutions better? ---------------------------------------------------------------- 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