Add limit of display

This commit is contained in:
Rafal Wojdyla 2016-09-29 17:34:41 -04:00
parent 9a21aa0a64
commit 89a2811853
2 changed files with 8 additions and 2 deletions

View file

@ -10,6 +10,12 @@
"propertyName": null,
"defaultValue": "--runner=InProcessPipelineRunner",
"description": "Scio interpreter wide arguments"
},
"zeppelin.scio.maxResult": {
"envName": "ZEPPELIN_SCIO_MAXRESULT",
"propertyName": "zeppelin.scio.maxResult",
"defaultValue": "1000",
"description": "Max number of SCollection result to display."
}
},
"editor": {

View file

@ -24,7 +24,7 @@ import scala.reflect.ClassTag
package object scio {
private val SCollectionEmptyMsg = "\n%html <font color=red>Result SCollection is empty!</font>\n"
private val maxResults = 1000
private val maxResults = Integer.getInteger("zeppelin.scio.maxResult", 1000)
private def materialize[T: ClassTag](self: SCollection[T]) = {
val f = self.materialize
@ -34,7 +34,7 @@ package object scio {
private def notifIfTruncated(it: Iterator[_]): Unit = {
if(it.hasNext)
println("\n<font color=red>Results are limited to " + maxResults + ".</font>\n")
println("\n<font color=red>Results are limited to " + maxResults + " rows.</font>\n")
}
// TODO: scala 2.11