TL;DR: ``` create table right_empty_table(k1 int); alter table right_empty_table set tiflash replica 1; create table left_table(k1 int, k2 int); insert into left_table values (1,1); alter table left_table set tiflash replica 1; set tidb_isolation_read_engines="tidb,tiflash"; ``` What was reported: GitHub issue pingcap/tidb#45300 (closed, 20 comments): ## Bug Report Please answer these questions before submitting your issue.

```text
[Runtime Filter] The ```Unexpected empty values``` error when filter values is empty
```

## Fix
1. ``` create table right_empty_table(k1 int); alter table right_empty_table set tiflash replica 1; create table left_table(k1 int, k2 int); insert into left_table values (1,1); alter table left_table set tiflash replica 1; set tidb_isolation_read_engines="tidb,tiflash"; ```.
   Expected: this specific failure stops.
2. enable runtime filter local.
   Expected: this specific failure stops.
3. ``` set tidb_runtime_filter_mode=LOCAL; ```.
   Expected: this specific failure stops.

## Details
What was reported: GitHub issue pingcap/tidb#45300 (closed, 20 comments): ## Bug Report Please answer these questions before submitting your issue. Thanks! ### 1. Minimal reproduce step (Required) 1. create table 3. query ``` mysql> select /*+ hash_join_build(right_empty_table) */ * from left_table , right_empty_table where 

What works:
[elsa0520 (reporter)]: The root cause is that the build side of ``` right_empty_table ``` is empty. So that the filter values is empty. When the filter convert to RS operator, the storage engine forbidden the empty IN RS operator. So it throws the ``` Unexpected empty values ``` error. The code of storage engine ``` IN.h ``` from ``` tiflash/dbms/src/storage/delatmerge/Filter/In.h ``` In(const Attr & attr_, const Fields & values_) : attr(attr_) , values(values_) { if (unlikely(values.empty())) throw Exception("Unexpected empty values"); } ```

## When to use
You hit exactly this: [Runtime Filter] The ```Unexpected empty values``` error when filter values is empty.

## When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.

## Compatibility
the tool named in the title.