Pyspark 'NoneType' object has no attribute '_jvm' error
https://www.py4u.net/discuss/13271This is a great example of why you shouldn't use import *.. The line. from pyspark.sql.functions import * . will bring in all the functions in the pyspark.sql.functions module into your namespace, include some that will shadow your builtins.. The specific issue is in the count_elements function on the line:. n = sum (1 for _ in iterator) # ^^^ - this is now pyspark.sql.functions.sum
Pyspark 'NoneType' object has no attribute '_jvm' error
www.py4u.net › discuss › 13271Answer #1: This is a great example of why you shouldn't use import *. will bring in all the functions in the pyspark.sql.functions module into your namespace, include some that will shadow your builtins. The specific issue is in the count_elements function on the line: You intended to call __builtin__.sum, but the import * shadowed the builtin.