Repository navigation
Commit 2824ba6
committed
[improvement](be) Avoid redundant ASCII scans in translate
### What problem does this PR solve?
Issue Number: N/A
Related PR: #69223
Problem Summary: translate checks from/to ASCII status unconditionally even
though the additional result is used only for two constant mappings. A
non-ASCII source with a varying replacement column therefore scans the whole
replacement column before using the same UTF-8 implementation. All-ASCII
inputs also repeat mapping scans. Dispatch on mapping constness first and
evaluate each needed ASCII predicate once. Non-ASCII constant mappings skip
the source check, while varying mappings preserve source-first short-circuiting.
The same conversion kernels are selected and SQL results remain unchanged.
No performance benchmark was run.
### Release note
Avoid redundant ASCII detection when evaluating translate with constant or
varying mapping arguments.
### Check List (For Author)
- Test: Passed build-support/check-format.sh with clang-format 16.0.6 and
git diff --check. Attempted the existing mixed constant-map unit test
using run-be-ut.sh -j 48 --run
--filter=function_string_test.function_translate_mixed_const_map_test
with ASAN. Build hygiene passed during configure, but CMake could not
find OpenMP_C, so compilation and test execution did not run.
- Behavior changed: No SQL semantic changes; reduces dispatch scanning.
- Does this need documentation: No1 parent 2d888fe commit 2824ba6
1 file changed
Lines changed: 16 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
973 | | - | |
974 | 972 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
986 | 989 | | |
987 | 990 | | |
988 | 991 | | |
| |||
0 commit comments