Rich-T-kid opened a new pull request, #27449: URL: https://github.com/apache/datafusion/pull/27449
## Which issue does this PR close?\n\n- Part of #20935.\n\n## Rationale for this change\n\nreplace currently materializes dictionary-encoded strings before applying scalar replacements. Low-cardinality inputs therefore repeat the same replacement work for every key occurrence.\n\nThis is a draft performance experiment. It is gated on the existing hosted TPC-H, TPC-DS, and partitioned ClickBench suites and will be closed if they do not show an attributable speedup.\n\n## What changes are included in this PR?\n\n- Preserve the haystack dictionary when the replacement arguments are scalar.\n- Apply replacement to dictionary values and reuse the input keys.\n- Compact oversized retained dictionaries before replacement.\n- Fall back to decoded arrays for array-valued replacement arguments.\n- Add coercion, null, scalar, fallback, and retained-dictionary tests.\n\nNo benchmark files or custom benchmark queries are added or changed.\n\n## What is the testing strategy?\n\n- cargo test -p datafusion-functions string::replace --lib\n- cargo clippy -p datafusion-functions --lib --tests -- -D warnings\n- cargo fmt --all -- --check\n- Full repository pre-push hook\n- Hosted TPC-H, TPC-DS, and partitioned ClickBench runs on the exact PR head\n\n## Are there any user-facing changes?\n\nLogical values are unchanged. Dictionary input with scalar replacement arguments now returns a dictionary array with the same key type. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
