korlov42 commented on code in PR #5398:
URL: https://github.com/apache/ignite-3/pull/5398#discussion_r1993257375
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/LogicalRelImplementor.java:
##########
@@ -1104,4 +1123,38 @@ private static BinaryTupleSchema
fromTableDescriptor(TableDescriptor descriptor)
return BinaryTupleSchema.create(elements);
}
+
+ private static boolean canFuseProjectionInto(RelNode rel) {
+ if (rel instanceof Join) {
+ Join join = (Join) rel;
+
+ return joinNeedsProjection(join);
+ }
+
+ return false;
+ }
+
+ private static boolean joinNeedsProjection(Join join) {
+ return join.getJoinType() == JoinRelType.INNER
+ || join.getJoinType() == JoinRelType.LEFT
+ || join.getJoinType() == JoinRelType.FULL
+ || join.getJoinType() == JoinRelType.RIGHT;
+ }
+
+ private @Nullable SqlJoinProjection<RowT> createJoinProjection(Join rel,
RelDataType outType) {
+ SqlJoinProjection<RowT> joinProjection = null;
+ if (projectionToFuse != null) {
+ assert joinNeedsProjection(rel);
+
+ joinProjection = expressionFactory.joinProject(projectionToFuse,
outType);
+
+ projectionToFuse = null;
Review Comment:
I've updated `joinWithProjectionOnTopReturnsValidaResults` to fail if
someone will forget to nullify `projectionToFuse`
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/LogicalRelImplementor.java:
##########
@@ -1104,4 +1123,38 @@ private static BinaryTupleSchema
fromTableDescriptor(TableDescriptor descriptor)
return BinaryTupleSchema.create(elements);
}
+
+ private static boolean canFuseProjectionInto(RelNode rel) {
+ if (rel instanceof Join) {
+ Join join = (Join) rel;
+
+ return joinNeedsProjection(join);
+ }
+
+ return false;
+ }
+
+ private static boolean joinNeedsProjection(Join join) {
+ return join.getJoinType() == JoinRelType.INNER
+ || join.getJoinType() == JoinRelType.LEFT
+ || join.getJoinType() == JoinRelType.FULL
+ || join.getJoinType() == JoinRelType.RIGHT;
+ }
Review Comment:
replaced, 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]