简体   繁体   English

AWS Glue PySpark无法计算记录

[英]AWS Glue PySpark can't count the records

I'm using AWS Glue to extract data from EC2 (Postgre) to be transformed and put it on S3 when I tried to extract 1 table. 我正在使用AWS Glue从EC2(Postgre)中提取要转换的数据,并在尝试提取1个表时将其放在S3上。 I got an error looks like this: 我收到一个错误,看起来像这样:

在此处输入图片说明

Is there anything I can do? 有什么我可以做的吗? I tried to drop null fields or fillna, but none of those works. 我试图删除空字段或fillna,但是这些都不起作用。

UPDATE: I even selected a string-type column but still got the same error: 更新:我什至选择了一个字符串类型的列,但仍然遇到相同的错误: 在此处输入图片说明

Can you try, df.isnull().any() or df.isnull().sum() . df.isnull().any()df.isnull().sum()是否可以尝试? This should help us see the columns with invalid NaN data. 这应该有助于我们查看包含无效NaN数据的列。 Also please try to fetch count of records with df.count(dropna = False) / df.na.drop() . 另外,请尝试使用df.count(dropna = False) / df.na.drop()获取记录数。 Please refer here , where its explained more in detail on handling null column data. 请参考此处 ,其中更详细地解释了如何处理空列数据。

Hope this helps. 希望这可以帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM