You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "bowenliang123 (via GitHub)" <gi...@apache.org> on 2023/06/14 03:36:19 UTC

[GitHub] [kyuubi] bowenliang123 opened a new pull request, #4959: [MINOR] Code improvements for Scala

bowenliang123 opened a new pull request, #4959:
URL: https://github.com/apache/kyuubi/pull/4959

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   - To improve Scala code with corrections, simplification, scala style, redundancy cleaning-up. No feature changes were introduced.
   
   Corrections:
   - Class doesn't correspond to file name
   - Correct package name
   
   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
   
   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 _
   
   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 commented on pull request #4959: [MINOR] Code improvements for Scala

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on PR #4959:
URL: https://github.com/apache/kyuubi/pull/4959#issuecomment-1594667467

   Thanks, merged to master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] codecov-commenter commented on pull request #4959: [MINOR] Code improvements for Scala

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #4959:
URL: https://github.com/apache/kyuubi/pull/4959#issuecomment-1591396993

   ## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#4959](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f549459) into [master](https://app.codecov.io/gh/apache/kyuubi/commit/050b5aa7df148fc11cdbe164f72061739566fdc4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (050b5aa) will **not change** coverage.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@          Coverage Diff           @@
   ##           master   #4959   +/-   ##
   ======================================
     Coverage    0.00%   0.00%           
   ======================================
     Files         563     563           
     Lines       30964   30964           
     Branches     4035    4035           
   ======================================
     Misses      30964   30964           
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...he/kyuubi/engine/spark/shim/SparkCatalogShim.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9zaGltL1NwYXJrQ2F0YWxvZ1NoaW0uc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...org/apache/spark/kyuubi/SparkProgressMonitor.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3Bhcmsva3l1dWJpL1NwYXJrUHJvZ3Jlc3NNb25pdG9yLnNjYWxh) | `0.00% <0.00%> (ø)` | |
   | [...rk/sql/execution/arrow/KyuubiArrowConverters.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3Bhcmsvc3FsL2V4ZWN1dGlvbi9hcnJvdy9LeXV1YmlBcnJvd0NvbnZlcnRlcnMuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [.../scala/org/apache/spark/ui/EngineSessionPage.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lU2Vzc2lvblBhZ2Uuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...scala/org/apache/kyuubi/config/ConfigBuilder.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvQ29uZmlnQnVpbGRlci5zY2FsYQ==) | `0.00% <0.00%> (ø)` | |
   | [...a/org/apache/kyuubi/service/TFrontendService.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2aWNlL1RGcm9udGVuZFNlcnZpY2Uuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...ala/org/apache/kyuubi/session/SessionManager.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL1Nlc3Npb25NYW5hZ2VyLnNjYWxh) | `0.00% <0.00%> (ø)` | |
   | [...rg/apache/kyuubi/ctl/cli/ControlCliArguments.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLWN0bC9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jdGwvY2xpL0NvbnRyb2xDbGlBcmd1bWVudHMuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...n/scala/org/apache/kyuubi/ctl/util/Tabulator.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLWN0bC9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jdGwvdXRpbC9UYWJ1bGF0b3Iuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...rg/apache/kyuubi/server/api/v1/AdminResource.scala](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvYXBpL3YxL0FkbWluUmVzb3VyY2Uuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | ... and [13 more](https://app.codecov.io/gh/apache/kyuubi/pull/4959?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 closed pull request #4959: [MINOR] Code improvements for Scala

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 closed pull request #4959: [MINOR] Code improvements for Scala
URL: https://github.com/apache/kyuubi/pull/4959


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org