Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Fix for [Runtime Filter] The ```Unexpected empty values``` error when filter values is empty: ``` 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. Use this when you hit exactly this in this tool. Not for different errors or different tools.

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.

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

Fix

  1. Expected: this specific failure stops.
  2. enable runtime filter local. Expected: this specific failure stops.

  3. 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 /+ hashjoinbuild(rightemptytable) / * from lefttable , rightempty_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.

Evidence

In the GitHub issue, the reporter asked: [Runtime Filter] The ``Unexpected empty values error when filter values is empty. The working answer that came out of the thread: [elsa0520 (reporter)]: The root cause is that the build side of 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 error. The code of storage engine from In(const Attr & attr_, const Fields & values_) : attr(attr_) , values(values_) { if (unlikely(values.empty())) throw Exception("Unexpected empty values"); } Source: https://github.com/pingcap/tidb/issues/45300

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_fWBobzKvvH1s77dW2WoB6Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[Runtime Filter] The ```Unexpected empty values``` error when filter values is empty <span>— Vectle</span></a>