[ 
https://issues.apache.org/jira/browse/BEAM-5113?focusedWorklogId=132761&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-132761
 ]

ASF GitHub Bot logged work on BEAM-5113:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Aug/18 23:06
            Start Date: 08/Aug/18 23:06
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #6186: 
[BEAM-5113][SQL] Add NOT LIKE based on LIKE expression
URL: https://github.com/apache/beam/pull/6186#discussion_r208763112
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/BeamSqlFnExecutor.java
 ##########
 @@ -278,7 +279,9 @@ private static BeamSqlExpression 
getBeamSqlExpression(RexNode rexNode) {
         case "LIKE":
           ret = new BeamSqlLikeExpression(subExps);
           break;
-
+        case "NOT LIKE":
+          ret = new BeamSqlNotLikeExpression(subExps);
 
 Review comment:
   Cool, I don't mind it this way.
   
   But I disagree that it is more readable :) It is a whole new separate class 
for NotLike. If I see it in the code, I would wonder how is it different from 
Like, and I have to read the whole class now to make sure it works as expected. 
And in this case I am confused because it defines operation for numbers and 
dates, so now I also have to read the `Like` class to learn that it's undefined 
there and throws exceptions. It also adds surface area for errors, now reading 
this I have to make sure that there's no `!` missing anywhere. Instead I could 
just read 2 lines of code :) and it doesn't have to be a boolean flag though, 
e.g.:
   
   ```
   enum Like { LIKE, NOT_LIKE }
   ...
   like = compare();
   return (type == NOT_LIKE) ? !like : like;
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 132761)
    Time Spent: 40m  (was: 0.5h)

> Test NOT LIKE
> -------------
>
>                 Key: BEAM-5113
>                 URL: https://issues.apache.org/jira/browse/BEAM-5113
>             Project: Beam
>          Issue Type: Sub-task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to