Skip to content

Commit

Permalink
feat(frontend): expose Vnode function as __rw_vnode for easy debu…
Browse files Browse the repository at this point in the history
…gging (#4327)

* expose internal `vnode` function as `__rw_vnode` for debugging

* add e2e test for `__rw_vnode` just to make sure the function runs

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
stdrc and mergify[bot] authored Aug 1, 2022
1 parent 0da423e commit 6bf43fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions e2e_test/batch/functions/internal.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
statement ok
SET RW_IMPLICIT_FLUSH TO true;

statement ok
create table t(v1 varchar, v2 int, v3 int)

statement ok
select __rw_vnode(_row_id) as vnode, _row_id from t;

statement ok
insert into t values ('aaa', 1, 1), ('bbb', 0, 2), ('ccc', 0, 5), ('ddd', 1, 4)

statement ok
select __rw_vnode(_row_id) as vnode, _row_id from t;

statement ok
drop table t
1 change: 1 addition & 0 deletions src/frontend/src/binder/expr/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ impl Binder {
"current_database" if inputs.is_empty() => {
return Ok(ExprImpl::literal_varchar(self.db_name.clone()));
}
"__rw_vnode" => ExprType::Vnode,
_ => {
return Err(ErrorCode::NotImplemented(
format!("unsupported function: {:?}", function_name),
Expand Down

0 comments on commit 6bf43fe

Please sign in to comment.