-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-12105 - SPARK-SQL add convenient show functions #10130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,12 +160,19 @@ class DataFrame private[sql]( | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Compose the string representing rows for output | ||
| */ | ||
| def showString(): String = { | ||
| showString(20); | ||
| } | ||
|
|
||
| /** | ||
| * Compose the string representing rows for output | ||
| * @param _numRows Number of rows to show | ||
| * @param truncate Whether truncate long strings and align cells right | ||
| */ | ||
| private[sql] def showString(_numRows: Int, truncate: Boolean = true): String = { | ||
| def showString(_numRows: Int, truncate: Boolean = true): String = { | ||
| val numRows = _numRows.max(0) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another minor thing: now that this is a public API we should expose a better parameter name
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andrewor14 Do we need similar change for dataset api ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's do that separately
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andrewor14 Thanks Andrew. |
||
| val sb = new StringBuilder | ||
| val takeResult = take(numRows + 1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
;, this is scala. I'll fix this on merge