[英]Snowflake COPY command directory read
COPY INTO SALES.SF_DEV.CUSTOMER_PARQUET_TGT FROM @EXTERNAL_STAGE_PARQUET_DEMO/partioned/customer/Country=INDIA/ MATCH_BY_COLUMN_NAME = CASE_SENSITIVE FILE_FORMAT = (TYPE = PARQUET);
The above command will load all the files recursively from dir Country=INDIA and all its sub-directories.上述命令将从 dir Country=INDIA 及其所有子目录递归加载所有文件。
Que: Do we have an option to control recursive file loading, what I mean to load only files from Country=INDIA not from its sub-directories? Que:我们是否可以选择控制递归文件加载,我的意思是只从 Country=INDIA 加载文件而不是从其子目录加载文件?
PS This image is with the pattern suggested by @gokhan PS这张图片是@gokhan建议的图案
Can you try to use the pattern option?您可以尝试使用模式选项吗?
COPY INTO SALES.SF_DEV.CUSTOMER_PARQUET_TGT
FROM @EXTERNAL_STAGE_PARQUET_DEMO/partioned/customer/Country=INDIA/
MATCH_BY_COLUMN_NAME = CASE_SENSITIVE FILE_FORMAT = (TYPE = PARQUET)
PATTERN = '[^\/]*';
The pattern is to prevent any sub-directories (files containing the slash characters).该模式是为了防止任何子目录(包含斜杠字符的文件)。
My test environment:我的测试环境:
ls @my_stage/test/Country=INDIA/;
+--------------------------------------------------------------------------+
| name |
+--------------------------------------------------------------------------+
| s3://mysecretbucketname/test/test/Country=INDIA/data_0_0_0.csv.gz |
| s3://mysecretbucketname/test/test/Country=INDIA/hododo/data_0_0_0.csv.gz |
+--------------------------------------------------------------------------+
ls @my_stage/test/Country=INDIA/ pattern = '[^\/]*';
+-------------------------------------------------------------------+
| name |
+-------------------------------------------------------------------+
| s3://mysecretbucketname/test/test/Country=INDIA/data_0_0_0.csv.gz |
+-------------------------------------------------------------------+
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.