korlov42 commented on code in PR #5746:
URL: https://github.com/apache/ignite-3/pull/5746#discussion_r2076941185
##########
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:
fixed, thanks
--
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]