Hi Ming,
I have played a little with a TMUDF that also outputs an unspecified set of
columns.
Try this...
    select * from  udf(solrUDF('db','iphone')) u *(id, whatever)* where u.id
= 1;
...that is, name the columns produced by the UDF.

cheers,
David Wong

On Wed, Jun 1, 2016 at 2:18 AM, Liu, Ming (Ming) <[email protected]> wrote:

> Hi, all,
>
>
>
> I wrote a simple TMUDF which will perform a solr query and get result as a
> table value.
>
>
>
> It can work like this:
>
>
>
> >>select * from  udf(solrUDF('db','iphone'));
>
> id       description
>
> ------ ----------------------------------------
>
> 1       iphone 5
>
> 2      iphone 5s
>
> --- 2 row(s) selected.
>
>
>
>
>
> As you can see, it will return two columns: ‘id’ and ‘description’. Now I
> want to do a filter on id, so I try this:
>
>
>
> >>select * from  udf(solrUDF('db','iphone')) u where u.id = 1;
>
>
>
> It failed and report this error:
>
>
>
> *** ERROR[4003] Column U.ID is not a column in table U, or, after a
> NATURAL JOIN or JOIN USING, is no longer allowed to be specified with a
> table correlation name.
>
>
>
> *** ERROR[8822] The statement was not prepared.
>
>
>
> Because I want to join the udf result from the source Trafodion table, so
> I have to reference the columns in the UDF.
>
>
>
> Please help, how can I reference to the column returned from a UDF?
>
>
>
> Thanks,
>
> Ming
>
>
>

Reply via email to