You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Izek Greenfield (Jira)" <ji...@apache.org> on 2021/07/29 05:53:00 UTC
[jira] [Updated] (SPARK-36329) show api of Dataset should get as
input the output method
[ https://issues.apache.org/jira/browse/SPARK-36329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Izek Greenfield updated SPARK-36329:
------------------------------------
Description:
For now show is:
{code:scala}
def show(numRows: Int, truncate: Boolean): Unit = if (truncate) {
println(showString(numRows, truncate = 20))
} else {
println(showString(numRows, truncate = 0))
}
{code}
it can be turn into:
{code:scala}
def show(numRows: Int, truncate: Boolean, out: String => Unit = println): Unit = if (truncate) {
out(showString(numRows, truncate = 20))
} else {
out(showString(numRows, truncate = 0))
}
{code}
so user will be able to send that to file/log...
was:
For now show is:
{code:scala}
def show(numRows: Int, truncate: Boolean): Unit = if (truncate) {
println(showString(numRows, truncate = 20))
} else {
println(showString(numRows, truncate = 0))
}
{code}
it can be turn into:
{code:scala}
def show(numRows: Int, truncate: Boolean, out: Any => Unit = println): Unit = if (truncate) {
out(showString(numRows, truncate = 20))
} else {
out(showString(numRows, truncate = 0))
}
{code}
so user will be able to send that to file/log...
> show api of Dataset should get as input the output method
> ---------------------------------------------------------
>
> Key: SPARK-36329
> URL: https://issues.apache.org/jira/browse/SPARK-36329
> Project: Spark
> Issue Type: Improvement
> Components: Spark Core
> Affects Versions: 3.1.2
> Reporter: Izek Greenfield
> Priority: Major
>
> For now show is:
> {code:scala}
> def show(numRows: Int, truncate: Boolean): Unit = if (truncate) {
> println(showString(numRows, truncate = 20))
> } else {
> println(showString(numRows, truncate = 0))
> }
> {code}
> it can be turn into:
> {code:scala}
> def show(numRows: Int, truncate: Boolean, out: String => Unit = println): Unit = if (truncate) {
> out(showString(numRows, truncate = 20))
> } else {
> out(showString(numRows, truncate = 0))
> }
> {code}
> so user will be able to send that to file/log...
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org