You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/29 03:31:50 UTC

[GitHub] [calcite] yanlin-Lynn commented on issue #1540: [CALCITE-3433] EQUALS operator between date/timestamp types returns false if the type is nullable

yanlin-Lynn commented on issue #1540: [CALCITE-3433] EQUALS operator between date/timestamp types returns false if the type is nullable
URL: https://github.com/apache/calcite/pull/1540#issuecomment-547240931
 
 
   There is already a `eq` function in `SqlFunctions`.
   How about call it when it's non primitive types.
   
   https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java#L619
   
   For this case,  the generated code may like this
   ```
   public Object current() {
                 final Object[] current = (Object[]) inputEnumerator.current();
                 final Long inp0_ = (Long) current[0];
                 final Long inp1_ = (Long) current[1];
                 return new Object[] {
                     inp0_ == null || inp1_ == null ? (Boolean) null : Boolean.valueOf(org.apache.calcite.runtime.SqlFunctions.eq(inp0_, inp1_)),
                     inp0_ == null || inp1_ == null ? (Boolean) null : Boolean.valueOf(org.apache.calcite.runtime.SqlFunctions.ne(inp0_, inp1_))};
               }
   
             };
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services