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

Replace map with expressions which produce no result with foreach

    XMLWordPrintableJSON

Details

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

    Description

      Use foreach instead of  map with expressions which produce no result.

       

      Before

       

      def functionWithNoReturnValue: Unit = {}  
      Seq(1, 2).map(functionWithNoReturnValue) 

       

       

      After

       

      def functionWithNoReturnValue: Unit = {}   
      Seq(1, 2).foreach(functionWithNoReturnValue) 

       

       

      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: