Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

jbonofre
Copy link
Member

@jbonofre jbonofre commented Dec 3, 2015

No description provided.

@jbonofre
Copy link
Member Author

jbonofre commented Dec 4, 2015

Rebase

@jbonofre jbonofre force-pushed the SPARK-12105 branch 5 times, most recently from b721fb2 to 61dd094 Compare December 9, 2015 17:39
writer.write(showString(numRows, truncate))
}

def show(numRows: Int, truncate: Boolean, writer: Writer): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these signatures are really clunky and I don't think we want it. Also the string is already composed so it's not like we're streaming things to the writer anyway.

@andrewor14
Copy link
Contributor

@jbonofre I think it might be sufficient to just expose showString. The new methods you added are kind of clunky to use. It might be good to also have an alias so the user can just call val x = df.showString().

@andrewor14
Copy link
Contributor

add to whitelist

@SparkQA
Copy link

SparkQA commented Dec 11, 2015

Test build #47589 has finished for PR 10130 at commit edbb87c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class ExecutorClassLoader(\n

@jbonofre
Copy link
Member Author

Thanks for the update @andrewor14. It makes sense for the new functions(). Exposing the showString() is enough for most of the cases. Let me update the PR.

@SparkQA
Copy link

SparkQA commented Dec 12, 2015

Test build #47594 has finished for PR 10130 at commit 219d75c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -17,7 +17,7 @@

package org.apache.spark.sql

import java.io.CharArrayWriter
import java.io.{OutputStreamWriter, Writer, OutputStream, CharArrayWriter}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer used

@SparkQA
Copy link

SparkQA commented Dec 15, 2015

Test build #47720 has finished for PR 10130 at commit 694e94f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

* Compose the string representing rows for output
*/
def showString(): String = {
showString(20);
Copy link
Contributor

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

@andrewor14
Copy link
Contributor

Merged into master.

@asfgit asfgit closed this in 31b3910 Dec 16, 2015
@rxin
Copy link
Contributor

rxin commented Dec 16, 2015

Sorry I reverted the patch. Please check with me on the API change in the future.

First I'm not 100% sure whether we want this (we might, just not sure yet), and then there are problems with the API (e.g. we should not use any default values for Java compatibility). Last but not least, if we want to do this, we should have it also for Python.

@jbonofre
Copy link
Member Author

Hi Reynold. No problem, I just proposed the PR as least to discuss, and I think it's convenient for users. Thanks.

@jbonofre
Copy link
Member Author

By the way, let me know if you want the change, I can extend to Python API as well. And what do you mean by default values about Java compatibility ?

@rxin
Copy link
Contributor

rxin commented Dec 17, 2015

Default parameter values only work in Scala, not Java.

@jjzazuet
Copy link

Hi. So it's 2018 and Dataset.scala still has

private[sql] def showString(_numRows: Int, truncate: Int = 20): String

I also vouch for having this method exposed as public to capture into logs in the driver program.

Thanks!

@dmateusp
Copy link

dmateusp commented Jul 6, 2018

+1 any chance we can revive this PR ?

@tmccartan
Copy link

+1

2 similar comments
@davis-x
Copy link

davis-x commented Sep 21, 2018

+1

@yousefpal
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants