Did you execute the query?
ProjectRemoveRule removes the Project when it is "trivial". Since the only
used project was pushed to BindableTableScan, the Project would only set the
alias, but that can be done in row type.
The result is correct because RowType is preserved with the alias. It just
does not show in the plan.
However, I seems that repeating a column with different aliases generates an
error:
SELECT k1 theKey, k1 theKey2 FROM tblspace1.tsql where k1 ='mykey2'
Regards,
Luis Fernando
Em sexta-feira, 17 de novembro de 2017 12:27:49 BRST, Enrico Olivelli
<[email protected]> escreveu:
Hi,
I have a ProjectableFilterableTable, it seems to me that the BindablaScan
RelNode does not keep track of column name aliases in the original
projection
Example:
Query:SELECT k1 theKey FROM tblspace1.tsql where k1 ='mykey2'
-- Logical Plan
LogicalProject(THEKEY=[$0])
LogicalFilter(condition=[=($0, 'mykey2')])
EnumerableTableScan(table=[[tblspace1, tsql]])
-- Best Plan
EnumerableInterpreter
BindableTableScan(table=[[tblspace1, tsql]], filters=[[=($0, 'mykey2')]],
projects=[[0]])
Is this correct ?
IMHO It would better to keep somethin like an EnumerableProjection which
renames the fields
Am I missing something ?
Thanks
Enrico