[jira] [Commented] (SPARK-43063) `df.show` handle null should print NULL instead of null

2023-08-14 Thread Snoot.io (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-43063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17754396#comment-17754396
 ] 

Snoot.io commented on SPARK-43063:
--

User 'andygrove' has created a pull request for this issue:
https://github.com/apache/spark/pull/42434

> `df.show` handle null should print NULL instead of null
> ---
>
> Key: SPARK-43063
> URL: https://issues.apache.org/jira/browse/SPARK-43063
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 3.4.0
>Reporter: yikaifei
>Assignee: yikaifei
>Priority: Trivial
> Fix For: 3.5.0
>
>
> `df.show` handle null should print NULL instead of null to consistent 
> behavior;
> {code:java}
> Like as the following behavior is currently inconsistent:
> ``` shell
> scala> spark.sql("select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 
> 'New Jersey', 4, 'Seattle') as result").show(false)
> +--+
> |result|
> +--+
> |null  |
> +--+
> ```
> ``` shell
> spark-sql> DESC FUNCTION EXTENDED decode;
> function_desc
> Function: decode
> Class: org.apache.spark.sql.catalyst.expressions.Decode
> Usage:
> decode(bin, charset) - Decodes the first argument using the second 
> argument character set.
> decode(expr, search, result [, search, result ] ... [, default]) - 
> Compares expr
>   to each search value in order. If expr is equal to a search value, 
> decode returns
>   the corresponding result. If no match is found, then it returns 
> default. If default
>   is omitted, it returns null.
> Extended Usage:
> Examples:
>   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
>abc
>   > SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>San Francisco
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>Non domestic
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle');
>NULL
> Since: 3.2.0
> Time taken: 0.074 seconds, Fetched 4 row(s)
> ```
> ``` shell
> spark-sql> select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New 
> Jersey', 4, 'Seattle');
> NULL
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-43063) `df.show` handle null should print NULL instead of null

2023-06-02 Thread GridGain Integration (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-43063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17728682#comment-17728682
 ] 

GridGain Integration commented on SPARK-43063:
--

User 'dongjoon-hyun' has created a pull request for this issue:
https://github.com/apache/spark/pull/41432

> `df.show` handle null should print NULL instead of null
> ---
>
> Key: SPARK-43063
> URL: https://issues.apache.org/jira/browse/SPARK-43063
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 3.4.0
>Reporter: yikaifei
>Assignee: yikaifei
>Priority: Trivial
> Fix For: 3.5.0
>
>
> `df.show` handle null should print NULL instead of null to consistent 
> behavior;
> {code:java}
> Like as the following behavior is currently inconsistent:
> ``` shell
> scala> spark.sql("select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 
> 'New Jersey', 4, 'Seattle') as result").show(false)
> +--+
> |result|
> +--+
> |null  |
> +--+
> ```
> ``` shell
> spark-sql> DESC FUNCTION EXTENDED decode;
> function_desc
> Function: decode
> Class: org.apache.spark.sql.catalyst.expressions.Decode
> Usage:
> decode(bin, charset) - Decodes the first argument using the second 
> argument character set.
> decode(expr, search, result [, search, result ] ... [, default]) - 
> Compares expr
>   to each search value in order. If expr is equal to a search value, 
> decode returns
>   the corresponding result. If no match is found, then it returns 
> default. If default
>   is omitted, it returns null.
> Extended Usage:
> Examples:
>   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
>abc
>   > SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>San Francisco
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>Non domestic
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle');
>NULL
> Since: 3.2.0
> Time taken: 0.074 seconds, Fetched 4 row(s)
> ```
> ``` shell
> spark-sql> select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New 
> Jersey', 4, 'Seattle');
> NULL
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-43063) `df.show` handle null should print NULL instead of null

2023-04-26 Thread Snoot.io (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-43063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17716964#comment-17716964
 ] 

Snoot.io commented on SPARK-43063:
--

User 'cloud-fan' has created a pull request for this issue:
https://github.com/apache/spark/pull/40922

> `df.show` handle null should print NULL instead of null
> ---
>
> Key: SPARK-43063
> URL: https://issues.apache.org/jira/browse/SPARK-43063
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 3.4.0
>Reporter: yikaifei
>Assignee: yikaifei
>Priority: Trivial
> Fix For: 3.5.0
>
>
> `df.show` handle null should print NULL instead of null to consistent 
> behavior;
> {code:java}
> Like as the following behavior is currently inconsistent:
> ``` shell
> scala> spark.sql("select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 
> 'New Jersey', 4, 'Seattle') as result").show(false)
> +--+
> |result|
> +--+
> |null  |
> +--+
> ```
> ``` shell
> spark-sql> DESC FUNCTION EXTENDED decode;
> function_desc
> Function: decode
> Class: org.apache.spark.sql.catalyst.expressions.Decode
> Usage:
> decode(bin, charset) - Decodes the first argument using the second 
> argument character set.
> decode(expr, search, result [, search, result ] ... [, default]) - 
> Compares expr
>   to each search value in order. If expr is equal to a search value, 
> decode returns
>   the corresponding result. If no match is found, then it returns 
> default. If default
>   is omitted, it returns null.
> Extended Usage:
> Examples:
>   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
>abc
>   > SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>San Francisco
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>Non domestic
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle');
>NULL
> Since: 3.2.0
> Time taken: 0.074 seconds, Fetched 4 row(s)
> ```
> ``` shell
> spark-sql> select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New 
> Jersey', 4, 'Seattle');
> NULL
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-43063) `df.show` handle null should print NULL instead of null

2023-04-10 Thread GridGain Integration (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-43063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17710133#comment-17710133
 ] 

GridGain Integration commented on SPARK-43063:
--

User 'Yikf' has created a pull request for this issue:
https://github.com/apache/spark/pull/40699

> `df.show` handle null should print NULL instead of null
> ---
>
> Key: SPARK-43063
> URL: https://issues.apache.org/jira/browse/SPARK-43063
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 3.4.0
>Reporter: yikaifei
>Priority: Trivial
>
> `df.show` handle null should print NULL instead of null to consistent 
> behavior;
> {code:java}
> Like as the following behavior is currently inconsistent:
> ``` shell
> scala> spark.sql("select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 
> 'New Jersey', 4, 'Seattle') as result").show(false)
> +--+
> |result|
> +--+
> |null  |
> +--+
> ```
> ``` shell
> spark-sql> DESC FUNCTION EXTENDED decode;
> function_desc
> Function: decode
> Class: org.apache.spark.sql.catalyst.expressions.Decode
> Usage:
> decode(bin, charset) - Decodes the first argument using the second 
> argument character set.
> decode(expr, search, result [, search, result ] ... [, default]) - 
> Compares expr
>   to each search value in order. If expr is equal to a search value, 
> decode returns
>   the corresponding result. If no match is found, then it returns 
> default. If default
>   is omitted, it returns null.
> Extended Usage:
> Examples:
>   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
>abc
>   > SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>San Francisco
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>Non domestic
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle');
>NULL
> Since: 3.2.0
> Time taken: 0.074 seconds, Fetched 4 row(s)
> ```
> ``` shell
> spark-sql> select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New 
> Jersey', 4, 'Seattle');
> NULL
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-43063) `df.show` handle null should print NULL instead of null

2023-04-09 Thread Hyukjin Kwon (Jira)


[ 
https://issues.apache.org/jira/browse/SPARK-43063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17710028#comment-17710028
 ] 

Hyukjin Kwon commented on SPARK-43063:
--

https://github.com/apache/spark/pull/40699

> `df.show` handle null should print NULL instead of null
> ---
>
> Key: SPARK-43063
> URL: https://issues.apache.org/jira/browse/SPARK-43063
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 3.4.0
>Reporter: yikaifei
>Priority: Trivial
>
> `df.show` handle null should print NULL instead of null to consistent 
> behavior;
> {code:java}
> Like as the following behavior is currently inconsistent:
> ``` shell
> scala> spark.sql("select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 
> 'New Jersey', 4, 'Seattle') as result").show(false)
> +--+
> |result|
> +--+
> |null  |
> +--+
> ```
> ``` shell
> spark-sql> DESC FUNCTION EXTENDED decode;
> function_desc
> Function: decode
> Class: org.apache.spark.sql.catalyst.expressions.Decode
> Usage:
> decode(bin, charset) - Decodes the first argument using the second 
> argument character set.
> decode(expr, search, result [, search, result ] ... [, default]) - 
> Compares expr
>   to each search value in order. If expr is equal to a search value, 
> decode returns
>   the corresponding result. If no match is found, then it returns 
> default. If default
>   is omitted, it returns null.
> Extended Usage:
> Examples:
>   > SELECT decode(encode('abc', 'utf-8'), 'utf-8');
>abc
>   > SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>San Francisco
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle', 'Non domestic');
>Non domestic
>   > SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 
> 4, 'Seattle');
>NULL
> Since: 3.2.0
> Time taken: 0.074 seconds, Fetched 4 row(s)
> ```
> ``` shell
> spark-sql> select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New 
> Jersey', 4, 'Seattle');
> NULL
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org