This query works:
select order_date, initcap(customer_name), count(*) AS number_of_orders
from ...
The initcap does as advertised and capitalizes the customer_name column.
However, if I wrap the same exact select in a create materialized view I get an error:
create or replace materialized view <my-view-name>
as
select order_date, initcap(customer_name), count(*) AS number_of_orders
from...
[DELTA_INVALID_CHARACTERS_IN_COLUMN_NAMES] Found invalid character(s) among ' ,;{}()\n\t=' in the column names of your schema. Invalid column names: initcap(customer_name). Please use other characters and try again. Alternatively, enable Column Mapping to keep using these characters.
Can you explain the difference?