即使在我尝试从以下代码导入 pyspark.sql.snappy 时重新安装 pyspark 和 snappydata 之后:
from pyspark.sql.snappy import SnappyContext
from pyspark.storagelevel import StorageLevel
SparkContext._ensure_initialized()
spark = SparkSession.builder.appName("test") \
.master("local[*]") \
.config("spark.snappydata.connection", "localhost:1527") \
.getOrCreate()
snappy = SnappySession(spark)
snappy.sql("SELECT col1, min(col2) from TABLE1")
我得到错误:
Traceback (most recent call last):
File "testpy.py", line 4, in <module>
from pyspark.sql.snappy import SnappyContext
ImportError: No module named snappy
请帮忙!