简体   繁体   English

使用pyspark分发到镶木地板的csv是否已分发?

[英]Is csv to parquet using pyspark distributed?

I have the following code snippet on an AWS EMR master node to convert a csv file to a parquet file. 我在AWS EMR主节点上具有以下代码片段,可将CSV文件转换为拼花文件。

%pyspark


csv_path = "s3://<bucket>/file.csv"
p_path = "s3://<bucket>/file.parquet"

df = sqlContext.read.csv(csv_path, header=True, inferSchema=True)
df.write.parquet(p_path, mode='overwrite')

If I request more nodes, will this operation be faster? 如果我请求更多节点,此操作会更快吗? In other words, is the conversion to parquet distributed in a spark cluster. 换句话说,是在火花簇中分配到拼花地板的转换。 I can't tell yet and I don't want to burn money on more nodes without knowing a little more about it. 我不能说,也不想在不了解更多信息的情况下在更多节点上花费金钱。

Yes, it is distributed. 是的,它是分布式的。

Will the operation be faster? 手术会更快吗? It depends on many factors, but in the best case it should scale linearly in terms of number of nodes as long as the code is equivalent to the one you (single stage job). 它取决于许多因素,但在最佳情况下,只要代码等于您的代码(单阶段作业),它就应根据节点数线性地扩展。

Another improvement to disable schema inference and providing explicit schema. 禁用模式推断并提供显式模式的另一项改进。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 pyspark 到 pyspark dataframe 从 s3 位置读取镶木地板文件的文件夹 - Read a folder of parquet files from s3 location using pyspark to pyspark dataframe 使用 PySpark 读取时过滤镶木地板文件 - Filtering parquet file on read with PySpark 如何使用 python 中的 spark dataframe 从 AWS S3 读取镶木地板文件(pyspark) - How to read parquet files from AWS S3 using spark dataframe in python (pyspark) 通过使用 pyspark 将 dataframe 的较小的多个拼花文件识别到单个分区 dataframe 中,进行 S3 压缩 - S3 compaction by identifying the smaller-multiple parquet files of a dataframe into single partition dataframe by using pyspark 使用 Pyspark 在 s3 中写入镶木地板文件时出错 - Error writing parquet file in s3 with Pyspark 使用AWS Glue将很大的csv.gz(每个30-40 GB)转换为镶木地板 - Using AWS Glue to convert very big csv.gz (30-40 gb each) to parquet 在 AWS lamda 中,如何使用 pandas to_csv 将我的 Parquet 文件转换为 CSV,并且我希望应该使用 PYTHON 将该 csv 文件插入到 postgresql - In AWS lamda how to convert my Parquet file to CSV using pandas to_csv and i want that csv file should be inserted to postgresql using PYTHON AWS Glue:无法将 CSV gzip 解析为 Parquet - AWS Glue: Unable to parse CSV gzip to Parquet 将 CSV 事件转换为 Parquet 的 Glue-Job - Glue-Job to convert CSV events into Parquet AWS Glue 作业 - 将 CSV 转换为 Parquet - AWS Glue Job - Convert CSV to Parquet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM