You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Peter Marron <Pe...@trilliumsoftware.com> on 2013/05/30 15:48:33 UTC

Access context from UDF

Hi,

Using Hive 0.10.0 over Hadoop 1.0.4.

I guess that I know that this is a long shot.
Is there any way to access the context from inside a UDF?
Specifically I want to get hold of the value of the virtual
column BLOCK__OFFSET__INSIDE__FILE from inside a
UDF that I'm implementing. Of course I can pass it in as
a parameter but it would be nice if I didn't have to.
So is there some way I can interrogate the value of this column?
Or, seeing as I can, that the value of the virtual column
is set using the value of
                ctx.getIoCxt().getCurrentBlockStart();
where ctx is an ExecMapperContext
is there some way that I can get hold of this
directly? Can the UDF get hold of the ExecMapperContext?

Thanks in advance.

Z



Re: Access context from UDF

Posted by Navis류승우 <na...@nexr.com>.
If VCs are not on query, it'll not be made in ExecMapper from start.

If you can do something with Reporter instance in MR,
https://issues.apache.org/jira/browse/HIVE-3628 would be helpful.

2013/5/30 Peter Marron <Pe...@trilliumsoftware.com>:
> Hi,
>
>
>
> Using Hive 0.10.0 over Hadoop 1.0.4.
>
>
>
> I guess that I know that this is a long shot.
>
> Is there any way to access the context from inside a UDF?
>
> Specifically I want to get hold of the value of the virtual
>
> column BLOCK__OFFSET__INSIDE__FILE from inside a
>
> UDF that I’m implementing. Of course I can pass it in as
>
> a parameter but it would be nice if I didn’t have to.
>
> So is there some way I can interrogate the value of this column?
>
> Or, seeing as I can, that the value of the virtual column
>
> is set using the value of
>
>                 ctx.getIoCxt().getCurrentBlockStart();
>
> where ctx is an ExecMapperContext
>
> is there some way that I can get hold of this
>
> directly? Can the UDF get hold of the ExecMapperContext?
>
>
>
> Thanks in advance.
>
>
>
> Z
>
>
>
>