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

Jason Dere commented on HIVE-11892:
-----------------------------------

As far as I can tell, it looks like GenericUDTF.close() isn't called until 
after CliDriver.processLocalCmd() has already finished going through the query 
results, so any rows added to the result at this point are never iterated over 
and printed.

{noformat}
ListSinkOperator.process(Object, int) line: 94  
UDTFOperator(Operator<T>).forward(Object, ObjectInspector) line: 813    
UDTFOperator.forwardUDTFOutput(Object) line: 126        
UDTFCollector.collect(Object) line: 45  
GenericUDTFCount2(GenericUDTF).forward(Object) line: 107        
GenericUDTFCount2.close() line: 48      
UDTFOperator.closeOp(boolean) line: 145 
UDTFOperator(Operator<T>).close(boolean) line: 617      
SelectOperator(Operator<T>).close(boolean) line: 631    
TableScanOperator(Operator<T>).close(boolean) line: 631 
FetchOperator.clearFetchContext() line: 523     
FetchTask.clearFetch() line: 181        
Driver.close() line: 1842       
CliDriver.processLocalCmd(String, CommandProcessor, CliSessionState) line: 250  
CliDriver.processCmd(String) line: 165  
CliDriver.processLine(String, boolean) line: 376        
CliDriver.executeDriver(CliSessionState, HiveConf, OptionsProcessor) line: 736  
CliDriver.run(String[]) line: 681       
CliDriver.main(String[]) line: 621      
{noformat}

> UDTF run in local fetch task does not return rows forwarded during 
> GenericUDTF.close()
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-11892
>                 URL: https://issues.apache.org/jira/browse/HIVE-11892
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Jason Dere
>
> Using the example UDTF GenericUDTFCount2, which is part of hive-contrib:
> {noformat}
> create temporary function udtfCount2 as 
> 'org.apache.hadoop.hive.contrib.udtf.example.GenericUDTFCount2';
> set hive.fetch.task.conversion=minimal;
> -- Task created, correct output (2 rows)
> select udtfCount2() from src;
> set hive.fetch.task.conversion=more;
> -- Runs in local task, incorrect output (0 rows)
> select udtfCount2() from src;
> {noformat}



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

Reply via email to