You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "yikf (Jira)" <ji...@apache.org> on 2021/02/07 12:01:00 UTC

[jira] [Updated] (SPARK-34395) Clean up unused code for code simplifications

     [ https://issues.apache.org/jira/browse/SPARK-34395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

yikf updated SPARK-34395:
-------------------------
    Description: 
Currently, we pass the default value `EmptyRow` to method `checkEvaluation` in the StringExpressionsSuite, but the default value of the 'checkEvaluation' method parameter is the `emptyRow`.

We can clean the parameter for Code Simplifications.

 

example:

*before:*
{code:java}
def testConcat(inputs: String*): Unit = {
  val expected = if (inputs.contains(null)) null else inputs.mkString
  checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected, EmptyRow)
}{code}
*after:*

 
{code:java}
def testConcat(inputs: String*): Unit = {
  val expected = if (inputs.contains(null)) null else inputs.mkString
  checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected)
}{code}

  was:
Currently, we pass the default value `EmptyRow` to method `checkEvaluation` in the StringExpressionsSuite, but the default value of the 'checkEvaluation' method parameter is the `emptyRow`.

We can clean the parameter for Code Simplifications.

 

example:

*before:*

*after:*

 


> Clean up unused code for code simplifications
> ---------------------------------------------
>
>                 Key: SPARK-34395
>                 URL: https://issues.apache.org/jira/browse/SPARK-34395
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0, 3.2.0
>            Reporter: yikf
>            Priority: Minor
>
> Currently, we pass the default value `EmptyRow` to method `checkEvaluation` in the StringExpressionsSuite, but the default value of the 'checkEvaluation' method parameter is the `emptyRow`.
> We can clean the parameter for Code Simplifications.
>  
> example:
> *before:*
> {code:java}
> def testConcat(inputs: String*): Unit = {
>   val expected = if (inputs.contains(null)) null else inputs.mkString
>   checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected, EmptyRow)
> }{code}
> *after:*
>  
> {code:java}
> def testConcat(inputs: String*): Unit = {
>   val expected = if (inputs.contains(null)) null else inputs.mkString
>   checkEvaluation(Concat(inputs.map(Literal.create(_, StringType))), expected)
> }{code}



--
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