Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 08-09-2016 11:23 PM - edited 08-18-2019 03:42 AM
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)
Created 08-10-2016 04:18 PM
I found the answer. In the Spark interpreter menu there is a "zeppelin.spark.printREPLOutput" property which you can set to false.
Created 08-10-2016 03:44 PM
@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?
Created on 08-10-2016 04:05 PM - edited 08-18-2019 03:42 AM
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).
Created 08-10-2016 04:18 PM
I found the answer. In the Spark interpreter menu there is a "zeppelin.spark.printREPLOutput" property which you can set to false.