我有许多外部表位于 S3 中的 csv 文件上。我在数字列中有字符串值,应将其解析为空,例如“na”。当我使用文件格式查询阶段时,这按预期工作。但是,在外部表中使用时出现错误“无法将变体值“na”修改为固定。任何人都能够帮助我理解为什么会出现这种情况?
create or replace file format csv_format
type = csv
field_delimiter = '||'
skip_header=1
encoding='ISO-8859-15'
null_if = 'na'
field_optionally_enclosed_by = '"'
create or replace external table ext_tbl(
col1 data as (value:c1::date)
,col2 number(18,2) as (value:c2::number(18,2)
)
location=@stage
file_format = 'csv_format';
我的表有数百列,因此我不想在列定义中使用 nullif。