ygerzhedovich commented on code in PR #5746: URL: https://github.com/apache/ignite-3/pull/5746#discussion_r2076885796
########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/rel/ProjectableFilterableTableScan.java: ########## @@ -173,8 +178,18 @@ public double estimateRowCount(RelMetadataQuery mq) { /** {@inheritDoc} */ @Override public RelDataType deriveRowType() { + RelDataTypeFactory typeFactory = Commons.typeFactory(getCluster()); + List<RexNode> projects = this.projects; + + if (projects == null && names != null) { + // Let's create fake identity projection just to preserve field names provided explicitly. + RelDataType type = table.unwrap(IgniteDataSource.class).getRowType(typeFactory, requiredColumns); + + projects = getCluster().getRexBuilder().identityProjects(type); + } + if (projects != null) { - return RexUtil.createStructType(Commons.typeFactory(getCluster()), projects); + return RexUtil.createStructType(Commons.typeFactory(getCluster()), projects, names, ATTEMPT_SUGGESTER); Review Comment: ```suggestion return RexUtil.createStructType(typeFactory, projects, names, ATTEMPT_SUGGESTER); ``` and below the same ########## modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/TpchQueryPlannerTest.java: ########## @@ -37,13 +37,6 @@ ) public class TpchQueryPlannerTest extends AbstractTpcQueryPlannerTest { @ParameterizedTest - // TODO: https://issues.apache.org/jira/browse/IGNITE-24195 Review Comment: Should it be rewritten to use the column names instead of $-named variable? It's good point to understand the issue and example where we can came into it -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org