Skip to content

Commit 3955637

Browse files
committed
improve test coverage
1 parent cc04a96 commit 3955637

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/sql/parse_tools/scalar_functions/parse_tables.test

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Before we load the extension, this will fail
66
statement error
7-
SELECT parse_tables('select 1');
7+
SELECT parse_tables('select * from MyTable');
88
----
99
Catalog Error: Scalar Function with name parse_tables does not exist!
1010

@@ -14,4 +14,17 @@ require parser_tools
1414
query I
1515
SELECT parse_tables('select * from MyTable');
1616
----
17-
[{'schema': main, 'table': MyTable, 'context': from}]
17+
[{'schema': main, 'table': MyTable, 'context': from}]
18+
19+
# demonstrate list filter functionality
20+
query I
21+
SELECT parse_tables('select * from MyTable t inner join Other o on o.id = t.id');
22+
----
23+
[{'schema': main, 'table': MyTable, 'context': from}, {'schema': main, 'table': Other, 'context': join_right}]
24+
25+
26+
# demonstrate list filter functionality
27+
query I
28+
SELECT list_filter(parse_tables('select * from MyTable t inner join Other o on o.id = t.id'),t -> t.context = 'from') AS filtered_tables;
29+
----
30+
[{'schema': main, 'table': MyTable, 'context': from}]

0 commit comments

Comments
 (0)