【发布时间】:2017-12-10 07:49:30
【问题描述】:
我在 Zeppelin 0.7 笔记本中使用 Spark 2 和 Scala 2.11。我有一个可以像这样打印的数据框:
dfLemma.select("text", "lemma").show(20,false)
输出如下:
+---------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|text |lemma |
+---------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|RT @Dope_Promo: When you and your crew beat your high scores on FUGLY FROG ???????? https://time.com/Sxp3Onz1w8 |[rt, @dope_promo, :, when, you, and, you, crew, beat, you, high, score, on, FUGLY, FROG, https://time.com/sxp3onz1w8] |
|RT @axolROSE: Did yall just call Kermit the frog a lizard? https://time.com/wDAEAEr1Ay |[rt, @axolrose, :, do, yall, just, call, Kermit, the, frog, a, lizard, ?, https://time.com/wdaeaer1ay] |
我正在尝试使 Zeppelin 中的输出更好,作者:
val printcols= dfLemma.select("text", "lemma")
println("%table " + printcols)
给出这个输出:
printcols: org.apache.spark.sql.DataFrame = [text: string, lemma: array<string>]
还有一个新的空白 Zeppelin 段落标题
[text: string, lemma: array]
有没有办法让数据框显示为格式良好的表格? 蒂亚!
【问题讨论】:
标签: scala apache-spark apache-zeppelin