Re: Assign alias to a column in RelBuilder

2018-08-27 Thread Michael Mior
Anand, Just a small request that if the responses others gave resolved your issue, it would be great if you could post the resolution on your Stack Overflow question. Thanks! https://stackoverflow.com/questions/51994631/assign-alias-to-a-column-in-calcite-relbuilder -- Michael Mior

Re: Assign alias to a column in RelBuilder

2018-08-23 Thread Julian Hyde
As Andrei says, using "RelBuilder.alias(RexNode, String)” on an expression in RelBuilder.project works. But only most of the time - RelBuilder reserves the right to discard projects that do nothing more than rename columns. Try using RelBuilder.rename. It will force creation of a Project even

Re: Assign alias to a column in RelBuilder

2018-08-23 Thread Andrei Sereda
The following works for me @Test public void relBuilderProjectAlias() throws Exception { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder.scan("EMP") .project( builder.alias(builder.field("EMPNO"), "aaa"),

Assign alias to a column in RelBuilder

2018-08-23 Thread Anand Gupta
Hi All, I am using RelBuilder to build relational expression and then converting it to a SQL query using Rel2SqlConverter. I skimmed through the examples of RelBuilder but