Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/819#discussion_r113762757
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/expr/annotations/FunctionTemplate.java
 ---
    @@ -106,15 +106,21 @@
         DECIMAL_ADD_SCALE,
         DECIMAL_SET_SCALE,
         DECIMAL_ZERO_SCALE,
    -    SC_BOOLEAN_OPERATOR
    +    SC_BOOLEAN_OPERATOR,
    --- End diff --
    
    I feel we probably overuse the concept of FunctionScope. The original 
intention, in my view, is to specify one function could be used in a context 
for aggregate (n -> 1 ) or simple (1 -> 1). Starting from the decimal 
functions, we add more possibilities of FunctionScope, while all those new 
possibilities are for different ways of inferring return types. In stead of 
keeping adding more for those string functions, can we probably add a new 
annotation to function template, to denote the return type infer logic for 
different functions?  I feel that the code might be cleaner. 
    
    On the other hand, I'm fine if we leave it as it is, since the new string 
functions are following existing approach, and may choose to revisit this later 
on. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to