How can I pass datasets between %pyspark interpreter and %python interpreters in Zeppelin?

泪湿孤枕 提交于 2019-12-02 05:20:06

You can put the result in ResourcePool via print it to %table.

%python
print('%table a\tb\n408+\t+408\n0001\t++99\n40817810300001453030\t0000040817810300001453030')

Then get in such way.

%spark.pyspark
ic = z.getInterpreterContext()
pool = ic.getResourcePool()
paragraphId = "20180828-093109_1491500809"
t = pool.get(ic.getNoteId(), paragraphId, "zeppelin.paragraph.result.table").get().toString()

print(t)

This way allows to transfer up to 50-100 megabytes of raw data.

Anyway I recommend to follow @zjffdu to use only one of these interpreters.

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