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

fix: treat change$* as internal columns #14061

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Dec 18, 2023

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

mark stream meta columns change$action, change$is_update, and change$row_id as Internal Columns,

so that test scenario of issue #14062 passes

mysql> create table t (c int);
Query OK, 0 rows affected (0.12 sec)

mysql> create stream s on table t ;
Query OK, 0 rows affected (0.12 sec)

mysql>
mysql> insert into t values(1);
Query OK, 1 row affected (0.14 sec)

mysql>
mysql> select * from s where change$action = 'INSERT';
+------+
| c    |
+------+
|    1 |
+------+
1 row in set (0.09 sec)
Read 1 rows, 133.00 B in 0.038 sec., 26.02 rows/sec., 3.38 KiB/sec.

mysql>
mysql> select * from s where change$is_update = false;
+------+
| c    |
+------+
|    1 |
+------+
1 row in set (0.09 sec)
Read 1 rows, 133.00 B in 0.039 sec., 25.72 rows/sec., 3.34 KiB/sec.

mysql>
mysql> select * from s where change$row_id = '1';
Empty set (0.13 sec)
Read 1 rows, 197.00 B in 0.043 sec., 23.39 rows/sec., 4.50 KiB/sec.

mysql> select *, change$row_id from s
    -> ;
+------+----------------------------------------+
| c    | change$row_id                          |
+------+----------------------------------------+
|    1 | 21cf143922c14704883f5264d09cc84b000000 |
+------+----------------------------------------+
1 row in set (0.12 sec)
Read 1 rows, 197.00 B in 0.037 sec., 26.86 rows/sec., 5.17 KiB/sec.

mysql> select * from s where change$row_id = '21cf143922c14704883f5264d09cc84b000000';
+------+
| c    |
+------+
|    1 |
+------+
1 row in set (0.14 sec)
Read 1 rows, 197.00 B in 0.042 sec., 23.85 rows/sec., 4.59 KiB/sec.

Fixes #14062

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Dec 18, 2023
@dantengsky dantengsky added the ci-cloud Build docker image for cloud test label Dec 18, 2023
Copy link
Contributor

Docker Image for PR

  • tag: pr-14061-0d1a632

note: this image tag is only available for internal use,
please check the internal doc for more details.

- `ORIGIN_BLOCK_ROW_NUM_COL_NAME`
- `BASE_ROW_ID_COL_NAME`
@dantengsky dantengsky changed the title fix: treat change$* as internal column fix: treat change$* as internal columns Dec 18, 2023
@dantengsky dantengsky marked this pull request as ready for review December 18, 2023 11:54
@dantengsky dantengsky requested a review from zhyass December 18, 2023 11:54
@BohuTANG BohuTANG merged commit ebec844 into databendlabs:main Dec 18, 2023
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cloud Build docker image for cloud test pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: ERROR 1105 (HY000): StorageOther. Code: 4000 if change$* used in Filtering criteria
3 participants