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

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

                Author: ASF GitHub Bot
            Created on: 21/Oct/21 06:23
            Start Date: 21/Oct/21 06:23
    Worklog Time Spent: 10m 
      Work Description: abstractdog commented on a change in pull request #2693:
URL: https://github.com/apache/hive/pull/2693#discussion_r733352864



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java
##########
@@ -69,8 +69,8 @@ protected void initializeOp(Configuration hconf) throws 
HiveException {
     this.runtimeCache = ObjectCacheFactory.getCache(getConfiguration(), 
queryId, false, true);
 
     // this can happen in HS2 while doing local fetch optimization, where 
LimitOperator is used
-    if (runtimeCache == null) {
-      if (!HiveConf.isLoadHiveServer2Config()) {
+    if (runtimeCache == null || !HiveConf.getVar(hconf, 
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")) {

Review comment:
       @dengzhhu653: I'm trying to understand how the original implementation 
led to empty result in MR, and why is the !tez condition helped...this will 
force the code to hit below codepath in MR, where we throw an exception if 
runtimeCache is null outside of HS2 or instantiate runtimeCache (in HS2)
   
   without this patch, what happened in case of MR? I guess as the patch forced 
to hit this condition:
   ```
   runtimeCache == null || !HiveConf.getVar(hconf, 
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("tez")
   ```
   even if the runtimeCache is not null, so runtimeCache should not have been 
null originally...if so, what's the value/point of the code inside the condition
   




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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 668108)
    Time Spent: 40m  (was: 0.5h)

> Empty result when using offset limit with MR
> --------------------------------------------
>
>                 Key: HIVE-25582
>                 URL: https://issues.apache.org/jira/browse/HIVE-25582
>             Project: Hive
>          Issue Type: Bug
>          Components: Operators
>    Affects Versions: 4.0.0
>            Reporter: Zhihua Deng
>            Assignee: Zhihua Deng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The _mr.ObjectCache_ caches nothing, every time when the limit [retrieving 
> global counter from the 
> cache|https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java#L150-L161],
>  a new AtomicInteger will be returned. This make offset _<= 
> currentCountForAllTasksInt_ always be evaluated to false, as _offset > 0_, 
> the operator will skip all rows.



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

Reply via email to