Pyspark - IndentationError: expected an indented block using Cloudera Virtual Machine

Pyspark - IndentationError: expected an indented block using Cloudera Virtual Machine

我正在使用 Cloudera 虚拟机快速入门下的终端 - 5.13.0-0-virtualbox。

employeeinfo = sqlContext.sql("SELECT * FROM EmployeeTab")
for row in employeeinfo.collect():
... print(row)

我收到这个错误:

IndentationError: expected an indented block

我想我在 for 循环之后放置了正确的空格,如下图所示:

我做错了什么?

非常感谢!

试试这个:

employeeinfo = sqlContext.sql("SELECT * FROM EmployeeTab")
for row in employeeinfo.collect():
...     print(row)

...

后加4个空格