Skip to content

Column identifier is case sensitive when used as a macro parameter. #9738

@Merujsy

Description

@Merujsy

What happens?

You have to match the exact casing of the column identifier when using them as macro parameter.

The following error is thrown when the casing does not match:
Error: Binder Error: Macro do_nothing does not have default parameter NAME!

When the casing does not match it is seen as the parameter name rather than a column.

Is this intended behaviour?

To Reproduce

Using CLI:

create table MY_TABLE(NAME String);
insert into my_table(name) values('Someone');
create or replace macro do_nothing(input) as input;

select name from my_table;
-- Works
select NAME from my_table;
-- Works
select do_nothing(NAME) from my_table;
-- Works
select do_nothing(name) from my_table;
-- Error: Binder Error: Macro do_nothing does not have default parameter NAME!

The casing did not matter when creating the table and inserting data. But the macro does expect the exact column name.

OS:

Windows 10

DuckDB Version:

0.9.2

DuckDB Client:

CLI

Full Name:

Pieter Bellon

Affiliation:

DXC Technology

Have you tried this on the latest main branch?

I have tested with a main build

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions