You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Rakesh Nair <19...@gmail.com> on 2019/03/26 06:52:28 UTC

Get Column Name

Hi,
I would like to know whether there's any way to *get the column names of
the table once it has been scanned*.


*RelBuilder builder = RelBuilder.create(config);*

*builder.scan("emp");*
*List<RexNode> ls = builder.fields();*

I've tried the *builder.fields() method*, but the return object is
containing names like $0, $1 etc..

Is there any way, I can actually get the column names itself from the
builder?

Regards,
Rakesh

Re: Get Column Name

Posted by Julian Hyde <jh...@apache.org>.
This should do it:

  builder.peek().getRowType().getFieldNames()

> On Mar 25, 2019, at 11:52 PM, Rakesh Nair <19...@gmail.com> wrote:
> 
> Hi,
> I would like to know whether there's any way to *get the column names of
> the table once it has been scanned*.
> 
> 
> *RelBuilder builder = RelBuilder.create(config);*
> 
> *builder.scan("emp");*
> *List<RexNode> ls = builder.fields();*
> 
> I've tried the *builder.fields() method*, but the return object is
> containing names like $0, $1 etc..
> 
> Is there any way, I can actually get the column names itself from the
> builder?
> 
> Regards,
> Rakesh