[英]How can I optimize the read from S3?
dyf_pagewise_word_count = glueContext.create_dynamic_frame.from_options(
connection_type="s3",
format="csv",
connection_options={
"paths": ["s3://somefile.csv/"],
'recurse':True,
'groupFiles': 'inPartition',
'groupSize': '100000'
},
format_options={
"withHeader": True,
"separator": ","
}
)
从 S3 读取需要 45 秒。 有什么办法可以优化阅读时间吗?
如果您使用的是 glue 3.0,则可以尝试使用optimizePerformance
选项。 它批处理记录以减少 IO。有关更多详细信息,请参阅此
dyf_pagewise_word_count = glueContext.create_dynamic_frame.from_options(
connection_type="s3",
format="csv",
connection_options={
"paths": ["s3://somefile.csv/"],
'recurse':True,
'groupFiles': 'inPartition',
'groupSize': '100000'
},
format_options={
"withHeader": True,
"separator": ",",
"optimizePerformance": True,
}
)
另外,您能否将 CSV 转换为读取上游的 Parquet 之类的东西?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.