【发布时间】:2018-11-19 20:57:18
【问题描述】:
例如,如果我使用 z.show() 直接输出表格
%pyspark
df = spark.createDataFrame([
(0, 0, "2018-06-03", "2018-06-03"),
(1, 1, "2018-06-04", "2018-06-04"),
(2, 10, "2018-06-03", None),
(4, 1, "2018-06-05", "2018-06-01")])\
.toDF("orderid", "customerid", "product_name", "product_name2")
print("test print string 1")
z.show(df)
z.show(df.describe())
输出很好,像这样
但是,如果我在输出表之间添加一个字符串
%pyspark
df = spark.createDataFrame([
(0, 0, "2018-06-03", "2018-06-03"),
(1, 1, "2018-06-04", "2018-06-04"),
(2, 10, "2018-06-03", None),
(4, 1, "2018-06-05", "2018-06-01")])\
.toDF("orderid", "customerid", "product_name", "product_name2")
print("test print string 1")
z.show(df)
print("test print string 2") # If I add this
z.show(df.describe())
输出变成这个,(没有表格显示)
我想知道,如何将string和Zeppelin的table show混合在一起?
我认为问题可能是由于字符串导致 Zeppelin 的表格显示格式错误?
【问题讨论】: