[SPARK-3781] code format and little improvement

1. use scala recommended usage
2. method body's left bracket
3. parameter list format
4. explicit mutable collection, such as "new mutable.HashMap"
5. others
can line length limit increase to 120 or more.
now the screen is bigger.
does long line code affect the compiling result and affect the program performance?