[ 
https://issues.apache.org/jira/browse/DRILL-4963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802688#comment-15802688
 ] 

ASF GitHub Bot commented on DRILL-4963:
---------------------------------------

Github user paul-rogers commented on the issue:

    https://github.com/apache/drill/pull/701
  
    General comment. Wasn't the design supposed to be that the lazy lookup 
would check for the function both in planning ("Calcite") and execution times? 
The whole point of the lazy init was to avoid per-query syncs (which will be 
prohibitively expensive for short queries) and to avoid race conditions.
    
    I wonder, is the problem the *way* in which we are checking for functions? 
The issue in this particular JIRA is a function with the same name as an 
existing function, but with different signature. Did the original lazy init 
check only names? Could a fix be to check name & signature?
    
    In general, the question is, can lazy init be preserved, but enhanced to 
handle the case described in the bug? It seems a shame to move away from it 
after all the effort that went into getting it (almost) right...
    
    If we switch to relying on syncing, we've got to rethink all the race 
conditions that were meant to be resolved with lazy init. Seems we'd have to 
update the design doc. to match. I'd really like to see if we can provide a fix 
that preserves the lazy init design so we keep the performance & concurrency 
benefits that it provides.


> Issues when overloading Drill native functions with dynamic UDFs
> ----------------------------------------------------------------
>
>                 Key: DRILL-4963
>                 URL: https://issues.apache.org/jira/browse/DRILL-4963
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.9.0
>            Reporter: Roman
>            Assignee: Arina Ielchiieva
>             Fix For: Future
>
>         Attachments: subquery_udf-1.0-sources.jar, subquery_udf-1.0.jar, 
> test_overloading-1.0-sources.jar, test_overloading-1.0.jar
>
>
> I created jar file which overloads 3 DRILL native functions 
> (LOG(VARCHAR-REQUIRED), CURRENT_DATE(VARCHAR-REQUIRED) and 
> ABS(VARCHAR-REQUIRED,VARCHAR-REQUIRED)) and registered it as dynamic UDF.
> If I try to use my functions I will get errors:
> {code:xml}
> SELECT CURRENT_DATE('test') FROM (VALUES(1));
> {code}
> Error: FUNCTION ERROR: CURRENT_DATE does not support operand types (CHAR)
> SQL Query null
> {code:xml}
> SELECT ABS('test','test') FROM (VALUES(1));
> {code}
> Error: FUNCTION ERROR: ABS does not support operand types (CHAR,CHAR)
> SQL Query null
> {code:xml}
> SELECT LOG('test') FROM (VALUES(1));
> {code}
> Error: SYSTEM ERROR: DrillRuntimeException: Failure while materializing 
> expression in constant expression evaluator LOG('test').  Errors: 
> Error in expression at index -1.  Error: Missing function implementation: 
> castTINYINT(VARCHAR-REQUIRED).  Full expression: UNKNOWN EXPRESSION.
> But if I rerun all this queries after "DrillRuntimeException", they will run 
> correctly. It seems that Drill have not updated the function signature before 
> that error. Also if I add jar as usual UDF (copy jar to 
> /drill_home/jars/3rdparty and restart drillbits), all queries will run 
> correctly without errors.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to