Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Is there a way to show only form output in a Zeppelin paragraph?

avatar

I'm using Zeppelin to build a simple interactive dashboard. I allow the user to select values from a dropdown, and want to show them the picklist, but not show them the Scala output underneath it. If I use the "Hide Output" button, my picklist is hidden as well.

See attached screenshot and code snippet:

val nodes = sqlContext.sql("select distinct node from nodes").collect().map(x => (x(0).asInstanceOf[String], x(0).asInstanceOf[String]))


val query = """
select
 concat_ws(',', collect_list(date_format(datetime, 'HH:mm'))) as time,
 concat_ws(',', collect_list(cast(diskbusy as string))) as Disk,
 concat_ws(',', collect_list(cast(cpuuser as string))) as CPUUser,
 concat_ws(',', collect_list(cast(cpusys as string))) as CPUSys,
 concat_ws(',', collect_list(cast(round(cpusys+cpuuser, 2) as string))) as CPU,
 concat_ws(',', collect_list(cast(round(100*memavailable/memtotal, 2) as string))) as Mem,
 concat_ws(',', collect_list(cast(greatest(unknown.requests, 0) as string))) as ExternalRequests,
 concat_ws(',', collect_list(cast(greatest(known.requests, 0) as string))) as InternalRequests,
 concat_ws(',', collect_list(cast(greatest(known.requests, 0) + greatest(unknown.requests, 0) as string))) as TotalRequests,
 concat_ws(',', collect_list(cast(round(memavailable/1000, 0) as string))) as MemAvail
from node_monitoring
left outer join (
  select date_format(datetime, 'HH:mm') as time, app_host, count(*) as requests
  from web_logs_enriched
  where source_host is not null or source_ip = '127.0.0.1'
  group by date_format(datetime, 'HH:mm'), app_host
) known
on node_monitoring.node = known.app_host and date_format(node_monitoring.datetime, 'HH:mm') = known.time
left outer join (
  select date_format(datetime, 'HH:mm') as time, app_host, count(*) as requests
  from web_logs_enriched
  where source_host is null
  group by date_format(datetime, 'HH:mm'), app_host
) unknown
on node_monitoring.node = unknown.app_host and date_format(node_monitoring.datetime, 'HH:mm') = unknown.time
where node = '""" + z.select("node", nodes) + """'
group by node
"""
val data2 = sqlContext.sql(query)
z.angularBind("data2", data2.collect())
z.angularBind("data2Schema", data2.schema)

6511-screen-shot-2016-08-09-at-72117-pm.png

1 ACCEPTED SOLUTION

avatar

I found the answer. In the Spark interpreter menu there is a "zeppelin.spark.printREPLOutput" property which you can set to false.

View solution in original post

3 REPLIES 3

avatar

@Randy Gelhausen You can switch your notebook to the report view, please see the dropdown top right. Screenshot attached.

Is this what you are looking for?

screen-shot-2016-08-10-at-114601-am.png

avatar

In report view, Zeppelin is still printing object reference information.

I want only the dropdown (green circle) to show to the end-user, and hide the standard Scala repl output (red rectangle).

6525-screen-shot-2016-08-10-at-120038-pm.png

avatar

I found the answer. In the Spark interpreter menu there is a "zeppelin.spark.printREPLOutput" property which you can set to false.