aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorzsxwing <zsxwing@gmail.com>2015-06-29 23:44:11 -0700
committerReynold Xin <rxin@databricks.com>2015-06-29 23:44:11 -0700
commit12671dd5e468beedc2681ff2bdf95fba81f8f29c (patch)
tree17fbc6f7141b79134002b8d3bb13900d773fb6a8 /R
parent6c5a6db4d53d6db8aa3464ea6713cf0d3a3bdfb5 (diff)
downloadspark-12671dd5e468beedc2681ff2bdf95fba81f8f29c.tar.gz
spark-12671dd5e468beedc2681ff2bdf95fba81f8f29c.tar.bz2
spark-12671dd5e468beedc2681ff2bdf95fba81f8f29c.zip
[SPARK-8434][SQL]Add a "pretty" parameter to the "show" method to display long strings
Sometimes the user may want to show the complete content of cells. Now `sql("set -v").show()` displays: ![screen shot 2015-06-18 at 4 34 51 pm](https://cloud.githubusercontent.com/assets/1000778/8227339/14d3c5ea-15d9-11e5-99b9-f00b7e93beef.png) The user needs to use something like `sql("set -v").collect().foreach(r => r.toSeq.mkString("\t"))` to show the complete content. This PR adds a `pretty` parameter to show. If `pretty` is false, `show` won't truncate strings or align cells right. ![screen shot 2015-06-18 at 4 21 44 pm](https://cloud.githubusercontent.com/assets/1000778/8227407/b6f8dcac-15d9-11e5-8219-8079280d76fc.png) Author: zsxwing <zsxwing@gmail.com> Closes #6877 from zsxwing/show and squashes the following commits: 22e28e9 [zsxwing] pretty -> truncate e582628 [zsxwing] Add pretty parameter to the show method in R a3cd55b [zsxwing] Fix calling showString in R 923cee4 [zsxwing] Add a "pretty" parameter to show to display long strings
Diffstat (limited to 'R')
-rw-r--r--R/pkg/R/DataFrame.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R
index 6feabf4189..60702824ac 100644
--- a/R/pkg/R/DataFrame.R
+++ b/R/pkg/R/DataFrame.R
@@ -169,8 +169,8 @@ setMethod("isLocal",
#'}
setMethod("showDF",
signature(x = "DataFrame"),
- function(x, numRows = 20) {
- s <- callJMethod(x@sdf, "showString", numToInt(numRows))
+ function(x, numRows = 20, truncate = TRUE) {
+ s <- callJMethod(x@sdf, "showString", numToInt(numRows), truncate)
cat(s)
})