morrySnow commented on issue #22528: URL: https://github.com/apache/doris/issues/22528#issuecomment-1665105315
这里存在语义差异,doris中字符串和数字比较时,会将字符串转为数字: ```sql stat_date = '20200601' --是字符串比较 stat_date = 20200601 --是数字比较 ``` | state_date值 | stat_date = '20200601' | stat_date = 20200601 | | -- | -- | -- | | '20200601' | true | true | | '020200601' | false | true | | 'abc' | false | null | 可以看到,两者的返回值并不一致。基于此,不能将`cast(stat_date as int) = 20200601`改写为`stat_date = '20200601'`以提升性能 -- 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: commits-unsubscr...@doris.apache.org 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