Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved reference while trying to import col from pyspark.sql.functions in python 3.5

Refer to the post here: Spark structured streaming with python I would like to import 'col' in python 3.5

from pyspark.sql.functions import col

However I got an error saying unresolved reference to col. I've installed pyspark library, so just wondering has the 'col' been removed from pyspark library? And how can I import the 'col' then.

like image 258
teddy Avatar asked Jul 28 '17 07:07

teddy


2 Answers

Try installing 'pyspark-stubs', I had the same problem in PyCharm and by doing it I resolved it.

like image 116
r.guerbab Avatar answered Nov 16 '22 05:11

r.guerbab


It turns out to be IntelliJ IDEA's problem. Even though it shows unresolved reference, my program still runs without any problem in the command line.

like image 34
teddy Avatar answered Nov 16 '22 03:11

teddy