简体   繁体   English

需要使用 Pyspark 处理 2 亿条记录

[英]Need to process 200 Million record using Pyspark

I am cleaning the data ( approx 200 Million rows) using python Pyspark but getting the error:我正在使用 python Pyspark 清理数据(大约 2 亿行),但出现错误:

ValueError: unichr() arg not in range(0x10000) (narrow Python build) ValueError: unichr() arg 不在范围内 (0x10000)(窄 Python 构建)

The size of the csv file is 21 GB and I added config('spark.driver.memory','8g') and I am using Macbook Pro 16GB. csv 文件的大小为 21 GB,我添加了config('spark.driver.memory','8g')并且我使用的是 Macbook Pro 16GB。

When I try to process the same file by reducing the size to 1GB, it executes successfully.当我尝试通过将大小减小到 1GB 来处理同一个文件时,它成功执行。

Any recommendations!!有什么推荐!!

I am using Apache 2.4我正在使用 Apache 2.4

Expected results: To process the raw_data.csv file Actual results: base =预期结果:处理raw_data.csv文件实际结果:base =

base[:pos] + unichr(char) + base[pos:]
ValueError: unichr() arg not in range(0x10000) (narrow Python build)

This error could be related to an unescaped unicode character in your char variable.此错误可能与char变量中未转义的 unicode 字符有关。 Could you try using:你可以尝试使用:

base = base[:pos] + char.decode('unicode-escape') + base[pos:]

Including your code would make it easier to help debug the issue.包含您的代码可以更轻松地帮助调试问题。

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

相关问题 用Python方式处理2亿个元素数据集的方法? - Pythonic way to process 200 million element data set? 如何使用 Python Pandas 处理 800 万条记录 - How to process 8 Million records using Python Pandas 如何使用 Pyspark 处理机器学习的数据帧 - How to process dataframe for ML using Pyspark 使用 Python/Pyspark 在 Salesforce 中查询具有 400 万条记录和 250 列的表 - Query a Table in Salesforce having 4 Million Records with 250 columns using Python/Pyspark 如何使用 Python 处理 Oracle DB 中的 1000 万条记录。 (cx_Oracle / Pandas) - How to process 10 million records in Oracle DB using Python. (cx_Oracle / Pandas) 如何使用 python 高速处理 csv 文件中的 1500 万行? - how to process 15 million of rows in csv file using python with high speed? 如何在 pyspark 中使用 ALS 记录每个纪元 RMSE - How to record each epoch RMSE using ALS in pyspark 找到每个组的前N个值,2亿行 - Finding top N values for each group, 200 million rows 在python中高效处理〜5000万条记录文件 - Efficiently processing ~50 million record file in python 使用queryset从django获取百万条记录很慢 - Get million record from django with queryset is slow
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM