Uh oh!
There was an error while loading. Please reload this page.
[function](cast)Make string casting to integers more like MySQL's beh… - #41541
Conversation
…avior (apache#38847) ## Proposed changes There are two issues here. First, the results of casting are inconsistent between FE and BE . ``` FE mysql [(none)]>select cast('3.000' as int); +----------------------+ | cast('3.000' as INT) | +----------------------+ | 3 | +----------------------+ mysql [(none)]>set debug_skip_fold_constant = true; BE mysql [(none)]>select cast('3.000' as int); +----------------------+ | cast('3.000' as INT) | +----------------------+ | NULL | +----------------------+ ``` The second issue is that casting on BE converts '3.0' to null. Here, the casting logic for FE and BE has been unified <!--Describe your changes.-->
doris-robot
commented
Oct 8, 2024
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Mryange
commented
Oct 8, 2024
run buildall |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Mryange
commented
Oct 8, 2024
run beut |
4c337aa to
cb9d8baCompareMryange
commented
Oct 8, 2024
run buildall |
doris-robot
commented
Oct 8, 2024
TeamCity be ut coverage result: |
Mryange
commented
Oct 8, 2024
run buildall |
doris-robot
commented
Oct 8, 2024
TeamCity be ut coverage result: |
Mryange
commented
Oct 8, 2024
run p0 |
| val = val * 10 + digit; | ||
| } else { | ||
| if ((UNLIKELY(i == first || !is_all_whitespace(s + i, len - i)))) { | ||
| if ((UNLIKELY(i == first || (!is_all_whitespace(s + i, len - i) && |
There was a problem hiding this comment.
之前的代码对于 “3 ” 能转为3
这里好像对 “3.1 ” 就不能转为3了
…avior (#38847)
#38847
Proposed changes
There are two issues here. First, the results of casting are inconsistent between FE and BE .
The second issue is that casting on BE converts '3.0' to null. Here, the casting logic for FE and BE has been unified
Proposed changes
Issue Number: close #xxx