You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Vimal Sharma <vi...@hortonworks.com> on 2016/09/06 07:44:52 UTC

Column lineage not set in HiveHook

Hi all,
I am trying to access the column lineage information from Hive Hook.
I am getting the lineage information from HookContext :

lInfo = hookContext.getLinfo()


But, when I try to access the Dependency in lInfo, it is null. Below is the sample code:


        for(Map.Entry<LineageInfo.DependencyKey, LineageInfo.Dependency> e : lInfo.entrySet()) {
            System.out.println("Col Lineage Key : " + e.getKey());
            System.out.println("Col Lineage Value: " + e.getValue());



I have updated my comment on a related JIRA https://issues.apache.org/jira/browse/HIVE-13112.

I would appreciate any help/suggestions in this issue.



Thanks

Vimal

Re: Column lineage not set in HiveHook

Posted by Vimal Sharma <vi...@hortonworks.com>.
The query is a CTAS operation.

create table t1(id int, name string);
create table t2 as select * from t1;

I am expecting dependencies t1.id -> t2.id and t1.name -> t2.name. But, it seems that the source column is not getting set properly during execution.
As a result, I am getting null in source column of a dependency.

Thanks
Vimal



On 9/6/16, 1:14 PM, "Vimal Sharma" <vi...@hortonworks.com> wrote:

>Hi all,
>I am trying to access the column lineage information from Hive Hook.
>I am getting the lineage information from HookContext :
>
>lInfo = hookContext.getLinfo()
>
>
>But, when I try to access the Dependency in lInfo, it is null. Below is the sample code:
>
>
>        for(Map.Entry<LineageInfo.DependencyKey, LineageInfo.Dependency> e : lInfo.entrySet()) {
>            System.out.println("Col Lineage Key : " + e.getKey());
>            System.out.println("Col Lineage Value: " + e.getValue());
>
>
>
>I have updated my comment on a related JIRA https://issues.apache.org/jira/browse/HIVE-13112.
>
>I would appreciate any help/suggestions in this issue.
>
>
>
>Thanks
>
>Vimal