Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: Support Sqrt, Ceil, Floor and CastIntAsReal push down to TiFlash #25085

Merged
merged 21 commits into from
Jun 4, 2021
Merged
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b27177f
add sqrt_floor_ceil_pushdown
chAngeZhaoZhanBo May 20, 2021
4cd6202
add CastIntAsReal pushdown
chAngeZhaoZhanBo May 24, 2021
948fc78
add CastDecimalAsReal pushdown
chAngeZhaoZhanBo May 24, 2021
dc66d5f
disable Ceil/FloorIntToDecimal pushdown
chAngeZhaoZhanBo Jun 2, 2021
6e5cdfb
Merge branch 'master' of https://github.com/pingcap/tidb into sqrt-ce…
chAngeZhaoZhanBo Jun 3, 2021
7f87559
Merge branch 'master' of https://github.com/pingcap/tidb into sqrt-ce…
chAngeZhaoZhanBo Jun 3, 2021
c8b48ba
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
be648f4
make fmt happy
chAngeZhaoZhanBo Jun 4, 2021
b0d028e
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
2ebedbe
add test for ceil,floor,sqrt TestExprPushDownToFlash
chAngeZhaoZhanBo Jun 4, 2021
3ca275a
Merge branch 'sqrt-ceil-floor-pushdown' of github.com:chAngeZhaoZhanB…
chAngeZhaoZhanBo Jun 4, 2021
960c584
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
a1df4f9
Merge branch 'master' into sqrt-ceil-floor-pushdown
ti-chi-bot Jun 4, 2021
1b9e827
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
2cfa992
make fmt happy
chAngeZhaoZhanBo Jun 4, 2021
da2cdf0
Merge branch 'master' into sqrt-ceil-floor-pushdown
ti-chi-bot Jun 4, 2021
a82fcf0
Merge branch 'master' into sqrt-ceil-floor-pushdown
zanmato1984 Jun 4, 2021
acfb6fa
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
eef8bc8
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
1064384
Merge branch 'master' into sqrt-ceil-floor-pushdown
chAngeZhaoZhanBo Jun 4, 2021
2e89003
Merge branch 'master' into sqrt-ceil-floor-pushdown
ti-chi-bot Jun 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,13 @@ func scalarExprSupportedByTiKV(sf *ScalarFunction) bool {

func scalarExprSupportedByFlash(function *ScalarFunction) bool {
switch function.FuncName.L {
case ast.Floor, ast.Ceil, ast.Ceiling:
switch function.Function.PbCode() {
case tipb.ScalarFuncSig_FloorIntToDec, tipb.ScalarFuncSig_CeilIntToDec:
return false
default:
return true
}
case
ast.LogicOr, ast.LogicAnd, ast.UnaryNot, ast.BitNeg, ast.Xor, ast.And, ast.Or,
ast.GE, ast.LE, ast.EQ, ast.NE, ast.LT, ast.GT, ast.In, ast.IsNull, ast.Like,
Expand All @@ -1004,6 +1011,7 @@ func scalarExprSupportedByFlash(function *ScalarFunction) bool {
ast.Concat, ast.ConcatWS,
ast.Year, ast.Month, ast.Day,
ast.DateDiff, ast.TimestampDiff, ast.DateFormat, ast.FromUnixTime,
ast.Sqrt,
ast.JSONLength:
return true
case ast.Substr, ast.Substring, ast.Left, ast.Right, ast.CharLength:
Expand Down