When RDBMS storage plugin is enabled, during query execution certain JDBC rules are added.
One of the rules is ProjectRemoveRule. Drill also uses this rule but during phases when it considers it useful, for example, during LOGICAL and JOIN_PLANNING. On the contrary, storage plugin rules are added to any phase of query planning. Thus it results to project stage to be removed when actually it is needed.
Sometimes when ProjectRemoveRule decides that project is trivial and removes it, during this stage Drill added column alias or removed implicit columns.
For example, with RDBMS plugin enabled, alias is not displayed for simple query:
Proposed fix is to move the creating of TopProject with validatedNodeType after physical planning is done.