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

Prasanth J commented on HIVE-8188:
----------------------------------

I tried to avoid this reflection invocation multiple times in inner loop by 
computing total aggregation size once and reusing it in inner loop. I ran the 
following query
{code}
select ss_quantity, ss_store_sk, ss_promo_sk, count(ss_list_price), 
count(ss_sales_price), sum(ss_ext_sales_price) from store_sales_orc group by 
ss_quantity,ss_store_sk,ss_promo_sk;
{code}

store_sales had 2880404 rows. The original execution time was 18.5s and with 
the above changes the time went down to 15.5s which is ~17% gain which explains 
the reflection cost from the attached image.

> ExprNodeGenericFuncEvaluator::_evaluate() loads class annotations in a tight 
> loop
> ---------------------------------------------------------------------------------
>
>                 Key: HIVE-8188
>                 URL: https://issues.apache.org/jira/browse/HIVE-8188
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.14.0
>            Reporter: Gopal V
>         Attachments: udf-deterministic.png
>
>
> When running a near-constant UDF, most of the CPU is burnt within the VM 
> trying to read the class annotations for every row.
> !udf-deterministic.png!



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

Reply via email to