Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-38267

Replace pattern matches on boolean expressions with conditional statements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • SQL
    • None

    Description

      Before

       

      val bool: Boolean
        bool match {
          case true => do something when bool is true
          case false => do something when bool is false
        } 

       

       

      After

       

      val bool: Boolean
        if (bool) {     
          do something when bool is true   
        } else {     
          do something when bool is false   
        } 

       

       

      Attachments

        Activity

          People

            LuciferYang Yang Jie
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: