Skip to content

Commit

Permalink
update planner test
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <wangrunji0408@163.com>
  • Loading branch information
wangrunji0408 committed Sep 11, 2023
1 parent db92f82 commit 3fe5841
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/frontend/planner_test/tests/testdata/input/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
CREATE TABLE t1(v1 varchar, v2 int, v3 int);
SELECT format('Testing %s, %I, %s, %%', v1, v2, v3) FROM t1;
expected_outputs:
- binder_error
- batch_plan
- sql: |
SELECT format('Testing %s, %s, %s, %%', 'one', 'two');
expected_outputs:
- binder_error
- batch_error
- sql: |
SELECT format('Testing %s, %s, %s, %', 'one', 'two', 'three');
expected_outputs:
- binder_error
- batch_error
- sql: |
SELECT format('Testing %s, %f, %d, %', 'one', 'two', 'three');
expected_outputs:
- binder_error
- batch_error
- sql: |
SELECT format();
expected_outputs:
Expand Down
30 changes: 8 additions & 22 deletions src/frontend/planner_test/tests/testdata/output/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,24 @@
SELECT format('Testing %s, %I, %s, %%', v1, v2, v3) FROM t1;
batch_plan: |-
BatchExchange { order: [], dist: Single }
└─BatchProject { exprs: [ConcatWs('':Varchar, 'Testing ':Varchar, t1.v1, ', ':Varchar, QuoteIdent(t1.v2), ', ':Varchar, t1.v3::Varchar, ', %':Varchar) as $expr1] }
└─BatchProject { exprs: [Format('Testing %s, %I, %s, %%':Varchar, t1.v1, t1.v2, t1.v3::Varchar) as $expr1] }
└─BatchScan { table: t1, columns: [t1.v1, t1.v2, t1.v3], distribution: SomeShard }
- sql: |
CREATE TABLE t1(v1 varchar, v2 int, v3 int);
SELECT format('Testing %s, %I, %s, %%', v1, v2, v3) FROM t1;
binder_error: |-
Bind error: failed to bind expression: format('Testing %s, %I, %s, %%', v1, v2, v3)
Caused by:
Feature is not yet implemented: QuoteIdent[Int32]
Tracking issue: https://github.com/risingwavelabs/risingwave/issues/112
batch_plan: |-
BatchExchange { order: [], dist: Single }
└─BatchProject { exprs: [Format('Testing %s, %I, %s, %%':Varchar, t1.v1, t1.v2::Varchar, t1.v3::Varchar) as $expr1] }
└─BatchScan { table: t1, columns: [t1.v1, t1.v2, t1.v3], distribution: SomeShard }
- sql: |
SELECT format('Testing %s, %s, %s, %%', 'one', 'two');
binder_error: |-
Bind error: failed to bind expression: format('Testing %s, %s, %s, %%', 'one', 'two')
Caused by:
Bind error: Function `format` required 3 arguments based on the `formatstr`, but 2 found.
batch_error: 'Expr error: too few arguments for format()'
- sql: |
SELECT format('Testing %s, %s, %s, %', 'one', 'two', 'three');
binder_error: |-
Bind error: failed to bind expression: format('Testing %s, %s, %s, %', 'one', 'two', 'three')
Caused by:
Bind error: unterminated format() type specifier
batch_error: 'Expr error: Parse error: unterminated format() type specifier'
- sql: |
SELECT format('Testing %s, %f, %d, %', 'one', 'two', 'three');
binder_error: |-
Bind error: failed to bind expression: format('Testing %s, %f, %d, %', 'one', 'two', 'three')
Caused by:
Bind error: unrecognized format() type specifier "f"
batch_error: 'Expr error: Parse error: unrecognized format() type specifier "f"'
- sql: |
SELECT format();
binder_error: |-
Expand Down

0 comments on commit 3fe5841

Please sign in to comment.