How to import Delta Lake module in Zeppelin notebook and pyspark?

左心房为你撑大大i 提交于 2020-06-14 07:56:11

问题


I am trying to use Delta Lake in a Zeppelin notebook with pyspark and seems it cannot import the module successfully. e.g.

%pyspark
from delta.tables import *

It fails with the following error:

ModuleNotFoundError: No module named 'delta'

However, there is no problem to save/read the data frame using delta format. And the module can be loaded successfully if using scala spark %spark

Is there any way to use Delta Lake in Zeppelin and pyspark?


回答1:


Finally managed to load it on zeppelin pyspark. Have to explicitly include the jar file

%pyspark
sc.addPyFile("**LOCATION_OF_DELTA_LAKE_JAR_FILE**")
from delta.tables import *


来源:https://stackoverflow.com/questions/59170595/how-to-import-delta-lake-module-in-zeppelin-notebook-and-pyspark

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!