admin管理员组文章数量:1391925
I am trying to read data from s3 to snowflake . Data is in Avro format and is in YYYY/MM/DD folder structure. I am trying to query this staging table in snowflake and I am getting an error
select
$1 as data,
substr(METADATA$FILENAME,31,10) as rpt_date
,METADATA$FILENAME FILENAME ,
METADATA$FILE_LAST_MODIFIED ,
METADATA$START_SCAN_TIME ,
$1:"App Selected Coverage"::varchar as APP_SELECTED_COVERAGE,
$1:"Prior_Term_POLICY_NUMBER"::varchar as PRIOR_TERM_POLICY_NUMBER
FROM @finance_analytics_stage limit 10
Error: 100084 (22P02): Error parsing AVRO: bad record field: "App Selected Coverage" contains a character which is not alphanumeric or _
How to query this stage?
I am trying to read data from s3 to snowflake . Data is in Avro format and is in YYYY/MM/DD folder structure. I am trying to query this staging table in snowflake and I am getting an error
select
$1 as data,
substr(METADATA$FILENAME,31,10) as rpt_date
,METADATA$FILENAME FILENAME ,
METADATA$FILE_LAST_MODIFIED ,
METADATA$START_SCAN_TIME ,
$1:"App Selected Coverage"::varchar as APP_SELECTED_COVERAGE,
$1:"Prior_Term_POLICY_NUMBER"::varchar as PRIOR_TERM_POLICY_NUMBER
FROM @finance_analytics_stage limit 10
Error: 100084 (22P02): Error parsing AVRO: bad record field: "App Selected Coverage" contains a character which is not alphanumeric or _
How to query this stage?
Share Improve this question asked Mar 14 at 2:34 Xi12Xi12 1,2337 gold badges20 silver badges50 bronze badges 1- What happens if you don't cast the "App Selected Coverage" as a VARCHAR? – Bryan Crystal-Thurston Commented Mar 14 at 13:10
1 Answer
Reset to default 0Snowflake's Avro parser complies with the Avro specications:
https://avro.apache./docs/1.12.0/specification/#names
The name portion of the fullname of named types, record field names, and enum symbols must:
start with [A-Za-z_] subsequently contain only [A-Za-z0-9_]
Snowflake's Avro parser checks if the field name consists of digits, alphanumeric characters, or underscores (_). Your field name contains space characters, which don't match any of the above. This is why you're encountering the error.
本文标签:
版权声明:本文标题:snowflake cloud data platform - Error parsing AVRO: bad record field , while querying from external stage - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744676031a2619114.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论