File: test_macro_issue_14276.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (11 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
# name: test/sql/catalog/function/test_macro_issue_14276.test
# description: Test Issue 14276 - Table function binder does not search other active binders
# group: [function]

statement ok
CREATE OR REPLACE MACRO extract_many(x, y) AS (SELECT struct_pack(*COLUMNS(z -> z in y)) FROM (SELECT unnest(x)));

query II
SELECT ['foo', 'baz'] AS k, extract_many(x, k) FROM (SELECT {'foo': 1, 'bar': 2, 'baz': 3} AS x);
----
[foo, baz]	{'foo': 1, 'baz': 3}