Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 是否可以将分区数据帧写入S3存储桶?_Amazon Web Services_Amazon S3_Pyspark_Partitioning_Aws Glue - Fatal编程技术网

Amazon web services 是否可以将分区数据帧写入S3存储桶?

Amazon web services 是否可以将分区数据帧写入S3存储桶?,amazon-web-services,amazon-s3,pyspark,partitioning,aws-glue,Amazon Web Services,Amazon S3,Pyspark,Partitioning,Aws Glue,我必须将Spark数据帧写入S3 bucket,它应该为每个分区创建一个单独的拼花文件 这是我的密码: dynamicDataFrame = DynamicFrame.fromDF( testDataFrame, glueContext , "dynamicDataFrame") glueContext.write_dynamic_frame.from_options(

我必须将Spark数据帧写入S3 bucket,它应该为每个分区创建一个单独的拼花文件

这是我的密码:

dynamicDataFrame = DynamicFrame.fromDF(
                       testDataFrame, glueContext , 
                       "dynamicDataFrame")

glueContext.write_dynamic_frame.from_options(
                  frame = dynamicDataFrame,
                  connection_type = "s3",  
                  connection_options = {
                            "path": "s3://BUCKET_NAME/DIR_NAME",
                             "partitionKeys": ["COL_NAME"]
                  },
                  format = "parquet"
 )
当我指定“partitionKeys”:[“COL_NAME”]选项时,胶水作业将在没有任何错误的情况下执行,但它不会在S3中创建任何文件

当我删除这个“partitionKeys”选项时,它会在S3中创建200个拼花地板文件(默认分区号为200)。 但是我想在特定列的基础上创建分区

那么,在S3中编写DF时,是否可以在S3中创建分区拼花文件


注意:我使用的是AWS资源,即AWS胶水。

R您确定分区列有数据吗


你在胶水日志中找到什么了吗?

肯定是的。您确定您的
dynamicDataFrame
不是空的吗?你使用书签吗?@YuriyBondaruk谢谢你的回复。。。是的,我确信我的动态数据框不是空的。但是,是的,我正在使用Bookmarking我删除了书签,但我仍然无法将分区DF写入S3。最初,它会创建一个临时目录,一旦作业完成,它也会删除该临时目录。发布解决方案可能对其他人有益。此外,dataframe和dynamicframe的工作原理略有不同。Dataframe支持s3,因此在写入s3之前无需将Dataframe转换为动态帧。感谢您花时间编写…这是我的错误..实际上,这是一个逻辑错误..现在工作正常