davidvrba opened a new pull request #27231: [SPARK-28478] [SQL] Remove 
redundant null checks
URL: https://github.com/apache/spark/pull/27231
 
 
   ### What changes were proposed in this pull request?
   The purpose of this pr is to remove explicit null checks if they are not 
needed in order to simplify the generated code. Here is one example: 
   
   Expressions of this type
   ```
   CASE WHEN isnull(title#5) THEN title#5 ELSE substring(title#5, 0, 3) END
   ```
   are simplified to 
   ```
   substring(title#5, 0, 3)
   ```
   if the considered expression is null-intolerant.
   
   <!--
   Please clarify what changes you are proposing. The purpose of this section 
is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster 
reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class 
hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other 
DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   It simplifies expressions in the query plan which leads to potential 
optimization due to simplified codegen.
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   
   ### How was this patch tested?
   New tests are added.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to