-
Notifications
You must be signed in to change notification settings - Fork 6.2k
expression: support pushing down TRIM to TiKV #67520
Description
Enhancement
TRIM is currently not pushed down to TiKV, while related functions such as LTRIM and RTRIM can already be pushed down.
From the current code and history, TRIM appears to have been disabled as part of a broader rollback of high-risk string function pushdown due to correctness concerns. At the same time, TiKV already has the
related execution support for TRIM, so the current gap is mainly that TiDB does not allow it to be pushed down.
This issue is to track re-evaluating and restoring TRIM pushdown to TiKV.
Background
TRIMis not pushed down to TiKV today.LTRIM/RTRIMare already supported for TiKV pushdown.- Historically,
TRIMwas removed together with some other string functions when there were correctness concerns around string function pushdown. - The rollback context can be found in:
- Earlier related history for
TRIMpushdown can be found in: - A more recent example of restoring a string function pushdown capability independently is:
What we want
Support pushing down TRIM to TiKV, with correctness as the first priority.
Scope
This issue is only for TRIM pushdown support.
It does not aim to restore all previously disabled string function pushdown in one batch.
Notes
Before enabling it again, we should make sure pushdown and non-pushdown paths return the same results for representative TRIM cases.