kyuubi/integration-tests
liangbowen eeee5c1ae3 [KYUUBI #4959] [MINOR] Code improvements for Scala
### _Why are the changes needed?_

- To improve Scala code with corrections, simplification, scala style, redundancy cleaning-up. No feature changes introduced.

Corrections:
- Class doesn't correspond to file name (SparkListenerExtensionTest)
- Correct package name in ResultSetUtil and PySparkTests

Improvements:
- 'var' could be a 'val'
- GetOrElse(null) to orNull

Cleanup & Simplification:
- Redundant cast inspection
- Redundant collection conversion
- Simplify boolean expression
- Redundant new on case class
- Redundant return
- Unnecessary parentheses
- Unnecessary partial function
- Simplifiable empty check
- Anonymous function convertible to a method value

Scala Style:
- Constructing range for seq indices
- Get and getOrElse to getOrElse
- Convert expression to Single Abstract Method (SAM)
- Scala unnecessary semicolon inspection
- Map and getOrElse(false) to exists
- Map and flatten to flatMap
- Null initializer can be replaced by _
- scaladoc link to method

Other Improvements:
- Replace map and getOrElse(true) with forall
- Unit return type in the argument of map
- Size to length on arrays and strings
- Type check can be pattern matching
- Java mutator method accessed as parameterless
- Procedure syntax in method definition

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4959 from bowenliang123/scala-Improve.

Closes #4959

2d36ff351 [liangbowen] code improvement for Scala

Authored-by: liangbowen <liangbowen@gf.com.cn>
Signed-off-by: liangbowen <liangbowen@gf.com.cn>
2023-06-16 21:20:17 +08:00
..
kyuubi-flink-it [KYUUBI #1652] Support Flink yarn application mode 2023-04-07 18:51:48 +08:00
kyuubi-hive-it Bump 1.8.0-SNAPSHOT 2023-02-10 15:25:49 +08:00
kyuubi-jdbc-it Bump 1.8.0-SNAPSHOT 2023-02-10 15:25:49 +08:00
kyuubi-kubernetes-it [KYUUBI #4681][Engine] Set thread CreateSparkTimeoutChecker daemon 2023-04-14 16:52:54 +08:00
kyuubi-trino-it [KYUUBI #4959] [MINOR] Code improvements for Scala 2023-06-16 21:20:17 +08:00
kyuubi-zookeeper-it Bump 1.8.0-SNAPSHOT 2023-02-10 15:25:49 +08:00
pom.xml Bump 1.8.0-SNAPSHOT 2023-02-10 15:25:49 +08:00