Suppose I have the following macro:
CREATE OR REPLACE MACRO hello_world(col_name, series_start, series_end) AS TABLE (
SELECT generate_series::VARCHAR AS col_name
FROM generate_series(series_start, series_end)
);
CREATE OR REPLACE TABLE tbl AS
FROM hello_world('world', 3, 5);
SHOW TABLES;
Execution produces:
┌─────────┐
│ name │
│ varchar │
├─────────┤
│ tbl │
└─────────┘
┌──────────┐
│ col_name │
│ varchar │
├──────────┤
│ 3 │
│ 4 │
│ 5 │
└──────────┘
But I wanted a column named 'world', yet I got a column named col_name (the macro parameter's name): so how do I correctly make sure that the macro parameter's value is used as a column name?