Try RelMetadataQuery.getColumnOrigin()

Jess

On Fri, Mar 17, 2017 at 3:07 AM, weijie tong <[email protected]>
wrote:

>     I have a requirement to find the on condition name of a join clause,
> but while the condition columns from two tables are the same ,I can not
> find the exact join column name.
>     For example : select col1 , col2 from table1 a join table2 b on a.colo
> = b.colo . When I apply a rule using HepPlanner, I want to find the
> condition names from both tables ,i.e. : colo and another colo , using the
> codes : joinRel.getRowType().getFieldList().get(index).getName() ,the
> index
> parameter was got from the condition method,the joinRel was the matched
> join RelNode. The reust is : colo and colo0 . As you see , the second joint
> key has a zero postfix.
>   I want to know how to find the correct joint column names at this case?
>

Reply via email to