我如何创建一个附加列并使用interschma synatx中的子句使用分区
我正在阅读S3的数据,以使用Inferschmea在雪花上创建外部表格。我正在从“表达式”列中获取所有列,但想在分区中使用其他列日期。如何使用Inferschmea实现这一目标?
create or replace external table people_test1
using template (
select expression,filenames, substr(filenames,24,10) DATE_PART
from table(
infer_schema(
location=>'@ITCHBOD.COMPANY_STAGE/cre/invets/',
file_format=>'CRUPARQUET',
partition by (DATE_PART)
)
)
)
I am reading data from s3 to create an external table in snowflake using inferschmea. I am getting all columns from the expression column but want to additional columns date to use it in the partition by. How can I achieve this using inferschmea?
create or replace external table people_test1
using template (
select expression,filenames, substr(filenames,24,10) DATE_PART
from table(
infer_schema(
location=>'@ITCHBOD.COMPANY_STAGE/cre/invets/',
file_format=>'CRUPARQUET',
partition by (DATE_PART)
)
)
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也有同样的问题。用SnowsQL:
1:创建像您做的
2:手动添加datePart
3:从表中生成ddl,并通过语句通过语句添加A替换
4:执行生成的DDL
我希望 ,我希望将其添加DDDL:有一天雪花提供更好的解决方案
Had the same issue. Solved it with a hacky workaround with snowsql:
1: Create the external table like you did
2: Manually add the datepart
3: Generate the DDL from the table and put the partition by statement in via a replace
4: execute the generated ddl
I hope Snowflake provides a better solution one day