Skip to content

Commit

Permalink
fix: treat change$* as internal columns (#14061)
Browse files Browse the repository at this point in the history
* fix: treat change$* as internal column

* fix:  more internel columns

- `ORIGIN_BLOCK_ROW_NUM_COL_NAME`
- `BASE_ROW_ID_COL_NAME`

* add sqllogic test

* refine sqllogic test
  • Loading branch information
dantengsky authored Dec 18, 2023
1 parent fc5a64c commit ebec844
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/query/expression/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ pub fn is_internal_column(column_name: &str) -> bool {
| BASE_BLOCK_IDS_COL_NAME
| ROW_NUMBER_COL_NAME
| PREDICATE_COLUMN_NAME
| CHANGE_ACTION_COL_NAME
| CHANGE_IS_UPDATE_COL_NAME
| CHANGE_ROW_ID_COL_NAME
// change$row_id might be expended
// to the computation of the two following internal columns
| ORIGIN_BLOCK_ROW_NUM_COL_NAME
| BASE_ROW_ID_COL_NAME
)
}

Expand Down
31 changes: 31 additions & 0 deletions tests/sqllogictests/suites/ee/01_ee_system/01_0003_stream.test
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,36 @@ drop table s2
statement ok
drop stream s2

###############
# issue 14062 #
###############

statement ok
create table t_14062 (c int);

statement ok
create stream s_14062 on table t_14062 ;

statement ok
insert into t_14062 values(1);

query T
select * from s_14062 where change$action = 'INSERT';
----
1

query T
select * from s_14062 where change$is_update = false;
----
1

query T
select * from s_14062 where change$row_id = '1';
----

######################
# end of issue 14062 #
######################

statement ok
DROP DATABASE IF EXISTS test_stream

0 comments on commit ebec844

Please sign in to comment.