github-actions[bot] commented on code in PR #65260:
URL: https://github.com/apache/doris/pull/65260#discussion_r3528089055
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/materialize/MaterializeProbeVisitor.java:
##########
@@ -152,7 +154,8 @@ public Optional<MaterializeSource>
visitPhysicalOlapScan(PhysicalOlapScan scan,
if (scan.getOperativeSlots().contains(context.slot)) {
return Optional.empty();
}
- return Optional.of(new MaterializeSource(scan, context.slot));
Review Comment:
This still does not get the nested access paths to BE. The visitor now
returns the relation output slot, but the slot that becomes the materialization
tuple descriptor is rebuilt later from the original lazy slot:
`PhysicalLazyMaterialize` does `((SlotReference)
lazySlot).withColumn(originalColumn)`, and `withColumn()` does not copy
`allAccessPaths`/`predicateAccessPaths`.
`generateTupleDesc(materialize.getOutput(), ...)` therefore creates a
`SlotDescriptor` with empty access paths, so the new `set_slot_access_paths()`
calls in BE are a no-op for the targeted rowid fetch. Please carry
`MaterializeSource.baseSlot`'s access paths onto the lazy output slot that is
serialized for the fetch request, and add a test that checks the
materialization tuple descriptor contains those paths.
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/processor/post/materialize/MaterializeProbeVisitorTest.java:
##########
@@ -0,0 +1,169 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.processor.post.materialize;
+
+import org.apache.doris.analysis.ColumnAccessPath;
Review Comment:
This import is unresolved in this branch. There is no
`org.apache.doris.analysis.ColumnAccessPath` class or
`ColumnAccessPath.data(...)` helper in the repo; the existing access-path
representation is the thrift
`TColumnAccessPath`/`TDataAccessPath`/`TAccessPathType` types. As written, the
new UT fails at compilation before it can exercise the PR.
##########
fe/fe-core/src/test/java/org/apache/doris/nereids/processor/post/materialize/MaterializeProbeVisitorTest.java:
##########
@@ -0,0 +1,169 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.processor.post.materialize;
+
+import org.apache.doris.analysis.ColumnAccessPath;
+import org.apache.doris.catalog.KeysType;
+import org.apache.doris.catalog.OlapTable;
+import org.apache.doris.nereids.trees.expressions.Add;
+import org.apache.doris.nereids.trees.expressions.Alias;
+import org.apache.doris.nereids.trees.expressions.Slot;
+import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.literal.IntegerLiteral;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.physical.PhysicalFilter;
+import org.apache.doris.nereids.trees.plans.physical.PhysicalOlapScan;
+import org.apache.doris.nereids.trees.plans.physical.PhysicalProject;
+import org.apache.doris.nereids.types.IntegerType;
+import org.apache.doris.qe.ConnectContext;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+
+public class MaterializeProbeVisitorTest {
+
+ @Test
+ public void testOlapScanRejectsRequiredMaterializedSlots() {
+ SlotReference baseSlot = new SlotReference("a", IntegerType.INSTANCE);
+ PhysicalOlapScan scan = mockBaseOlapScan(baseSlot);
+
+ Set<Slot> requiredMaterializedSlots = new HashSet<>();
+ requiredMaterializedSlots.add(baseSlot);
+ MaterializeProbeVisitor.ProbeContext context = new
MaterializeProbeVisitor.ProbeContext(
Review Comment:
This test class will not compile: `ProbeContext` only has the
single-argument constructor `ProbeContext(SlotReference slot)`, but this and
two later tests call `new ProbeContext(slot, requiredMaterializedSlots)`.
Please either add the intended constructor/state to
`MaterializeProbeVisitor.ProbeContext` or rewrite these tests to use the
current API before landing the UT.
--
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]