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

ASF GitHub Bot logged work on HIVE-24645:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jan/21 17:47
            Start Date: 15/Jan/21 17:47
    Worklog Time Spent: 10m 
      Work Description: jfsii opened a new pull request #1876:
URL: https://github.com/apache/hive/pull/1876


   Change-Id: Ic6ddbf9ffb14c293caadf1f8ec1e7ec0f9291a31
   
   ### What changes were proposed in this pull request?
   UDF configure does not get called if fetch task conversion happens.
   This attempts to resolve this by calling configure with a dummy 
MapredContext.
   It is a bit ugly in that MapredContext seems to be legacy baggage with 
various members that do not make sense for a variety of engines and code.
   
   
   ### Why are the changes needed? Some custom UDFs are designed with the 
expectation that configure is called in all instances. Users sometimes use it 
to inspect configuration values or to set new values to propagate to the 
evaluate method or to do one time setup.
   
   ### Does this PR introduce _any_ user-facing change? Yes - it will now call 
configure in cases where configure was not called before.
   
   
   ### How was this patch tested? Added udf_configure.q and manual testing
   


----------------------------------------------------------------
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


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

            Worklog Id:     (was: 536563)
    Remaining Estimate: 0h
            Time Spent: 10m

> UDF configure not called when fetch task conversion occurs
> ----------------------------------------------------------
>
>                 Key: HIVE-24645
>                 URL: https://issues.apache.org/jira/browse/HIVE-24645
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>            Reporter: John Sherman
>            Assignee: John Sherman
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When hive.fetch.task.conversion kicks in - UDF configure is not called.
> This is likely due to MapredContext not being available when this conversion 
> occurs.
> The approach I suggest is to create a dummy MapredContext and provide it with 
> the current configuration from ExprNodeGenericFuncEvaluator.
> It is slightly unfortunate that the UDF API relies on MapredContext since 
> some aspects of the context do not apply to the variety of engines and 
> invocation paths for UDFs which makes it difficult to make a fully formed 
> dummy object such as the Reporter objects and the boolean around if it is a 
> Map context.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to