From 070346a85b1daa63b94e30d218d73a76a96b7fc2 Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Thu, 26 Aug 2021 15:04:06 +0800 Subject: [PATCH 1/5] This is an automated cherry-pick of #6188 Signed-off-by: ti-chi-bot --- tiflash/use-tiflash.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tiflash/use-tiflash.md b/tiflash/use-tiflash.md index e8ef201eb05a6..5f12af1617897 100644 --- a/tiflash/use-tiflash.md +++ b/tiflash/use-tiflash.md @@ -244,14 +244,17 @@ Currently, TiFlash supports the following push-down expressions: * Mathematical functions: `+, -, /, *, >=, <=, =, !=, <, >, round(int), round(double), abs, floor(int), ceil(int), ceiling(int)` * Logical functions: `and, or, not, case when, if, ifnull, isnull, in` * Bitwise operations: `bitand, bitor, bigneg, bitxor` +<<<<<<< HEAD * String functions: `substr, char_length, replace, concat, concat_ws, left, right` * Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), date_add(string, int), date_add(datetime, int), date_sub(datetime, int), date_sub(string, int), datediff, year, month, day, extract(datetime)` +======= +* String functions: `substr, char_length, replace, concat, concat_ws, left, right, ascii, length, trim, position` +* Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime), date` +>>>>>>> 36ef0f5a0 (tiflash: Remove the description about expr_blacklist in use_tiflash.md (#6188)) * JSON function: `json_length` * Conversion functions: `cast(int as double), cast(int as decimal), cast(int as string), cast(int as time), cast(double as int), cast(double as decimal), cast(double as string), cast(double as time), cast(string as int), cast(string as double), cast(string as decimal), cast(string as time), cast(decimal as int), cast(decimal as string), cast(decimal as time), cast(time as int), cast(time as decimal), cast(time as string)` * Aggregate functions: `min, max, sum, count, avg, approx_count_distinct` -Among them, the push-down of `cast` and `date_add` is not enabled by default. To enable it, refer to [Blocklist of Optimization Rules and Expression Pushdown](/blocklist-control-plan.md). - In addition, expressions that contain the Time/Bit/Set/Enum/Geometry type cannot be pushed down to TiFlash. If a query encounters unsupported push-down calculations, TiDB needs to complete the remaining calculations, which might greatly affect the TiFlash acceleration effect. The currently unsupported operators and expressions might be supported in future versions. From 8af89ec00806b683c660265e9835591090ae17d5 Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:13:33 +0800 Subject: [PATCH 2/5] Update tiflash/use-tiflash.md --- tiflash/use-tiflash.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tiflash/use-tiflash.md b/tiflash/use-tiflash.md index 5f12af1617897..47360b0f8b89c 100644 --- a/tiflash/use-tiflash.md +++ b/tiflash/use-tiflash.md @@ -244,10 +244,6 @@ Currently, TiFlash supports the following push-down expressions: * Mathematical functions: `+, -, /, *, >=, <=, =, !=, <, >, round(int), round(double), abs, floor(int), ceil(int), ceiling(int)` * Logical functions: `and, or, not, case when, if, ifnull, isnull, in` * Bitwise operations: `bitand, bitor, bigneg, bitxor` -<<<<<<< HEAD -* String functions: `substr, char_length, replace, concat, concat_ws, left, right` -* Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), date_add(string, int), date_add(datetime, int), date_sub(datetime, int), date_sub(string, int), datediff, year, month, day, extract(datetime)` -======= * String functions: `substr, char_length, replace, concat, concat_ws, left, right, ascii, length, trim, position` * Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime), date` >>>>>>> 36ef0f5a0 (tiflash: Remove the description about expr_blacklist in use_tiflash.md (#6188)) From 9bebb00c108388b0daf27166ba9539b37263b16e Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:14:13 +0800 Subject: [PATCH 3/5] Update tiflash/use-tiflash.md --- tiflash/use-tiflash.md | 1 - 1 file changed, 1 deletion(-) diff --git a/tiflash/use-tiflash.md b/tiflash/use-tiflash.md index 47360b0f8b89c..6dd0da4acd1d8 100644 --- a/tiflash/use-tiflash.md +++ b/tiflash/use-tiflash.md @@ -246,7 +246,6 @@ Currently, TiFlash supports the following push-down expressions: * Bitwise operations: `bitand, bitor, bigneg, bitxor` * String functions: `substr, char_length, replace, concat, concat_ws, left, right, ascii, length, trim, position` * Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime), date` ->>>>>>> 36ef0f5a0 (tiflash: Remove the description about expr_blacklist in use_tiflash.md (#6188)) * JSON function: `json_length` * Conversion functions: `cast(int as double), cast(int as decimal), cast(int as string), cast(int as time), cast(double as int), cast(double as decimal), cast(double as string), cast(double as time), cast(string as int), cast(string as double), cast(string as decimal), cast(string as time), cast(decimal as int), cast(decimal as string), cast(decimal as time), cast(time as int), cast(time as decimal), cast(time as string)` * Aggregate functions: `min, max, sum, count, avg, approx_count_distinct` From c4d3451d9b9eff38c9085dfe1284324e6983fd3c Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:19:48 +0800 Subject: [PATCH 4/5] Apply suggestions from code review --- tiflash/use-tiflash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/use-tiflash.md b/tiflash/use-tiflash.md index 6dd0da4acd1d8..403577583eb39 100644 --- a/tiflash/use-tiflash.md +++ b/tiflash/use-tiflash.md @@ -244,7 +244,7 @@ Currently, TiFlash supports the following push-down expressions: * Mathematical functions: `+, -, /, *, >=, <=, =, !=, <, >, round(int), round(double), abs, floor(int), ceil(int), ceiling(int)` * Logical functions: `and, or, not, case when, if, ifnull, isnull, in` * Bitwise operations: `bitand, bitor, bigneg, bitxor` -* String functions: `substr, char_length, replace, concat, concat_ws, left, right, ascii, length, trim, position` +* String functions: `substr, char_length, replace, concat, concat_ws, left, right` * Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime), date` * JSON function: `json_length` * Conversion functions: `cast(int as double), cast(int as decimal), cast(int as string), cast(int as time), cast(double as int), cast(double as decimal), cast(double as string), cast(double as time), cast(string as int), cast(string as double), cast(string as decimal), cast(string as time), cast(decimal as int), cast(decimal as string), cast(decimal as time), cast(time as int), cast(time as decimal), cast(time as string)` From 34c1cf6ef9d43f28a10a0df86bced28055d3e24d Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:20:27 +0800 Subject: [PATCH 5/5] Update tiflash/use-tiflash.md --- tiflash/use-tiflash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/use-tiflash.md b/tiflash/use-tiflash.md index 403577583eb39..6fa5f005ae7b8 100644 --- a/tiflash/use-tiflash.md +++ b/tiflash/use-tiflash.md @@ -245,7 +245,7 @@ Currently, TiFlash supports the following push-down expressions: * Logical functions: `and, or, not, case when, if, ifnull, isnull, in` * Bitwise operations: `bitand, bitor, bigneg, bitxor` * String functions: `substr, char_length, replace, concat, concat_ws, left, right` -* Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime), date` +* Date functions: `date_format, timestampdiff, from_unixtime, unix_timestamp(int), unix_timestamp(decimal), str_to_date(date), str_to_date(datetime), datediff, year, month, day, extract(datetime)` * JSON function: `json_length` * Conversion functions: `cast(int as double), cast(int as decimal), cast(int as string), cast(int as time), cast(double as int), cast(double as decimal), cast(double as string), cast(double as time), cast(string as int), cast(string as double), cast(string as decimal), cast(string as time), cast(decimal as int), cast(decimal as string), cast(decimal as time), cast(time as int), cast(time as decimal), cast(time as string)` * Aggregate functions: `min, max, sum, count, avg, approx_count_distinct`