jayzhan211 commented on PR #12184:
URL: https://github.com/apache/datafusion/pull/12184#issuecomment-2311601582
> > The plan looks like aliasing to the same name after
`optimize_projections`
> > ```
> > Projection: test.a AS test.a
> > TableScan: test projection=[a]
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > I wonder could we even remove the alias here, since the name is the same
>
> Removing the Alias will cause a schema change. 🤔
That is why I think the root cause might be the incorrect schema we have.
`SELECT "test.a" FROM (SELECT a AS "test.a" FROM test)`
The expected schema should be something like.
```
DFSchema { inner: Schema { fields: [Field { name: "test.a", data_type:
Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }],
metadata: {} }, field_qualifiers: [Some(Bare { table: "test" })],
functional_dependencies: FunctionalDependencies { deps: [] } }.
```
a is aliased to "test.a". The column should be `test."test.a"`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]