Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,20 @@ public Void visitLogicalProject(LogicalProject<? extends Plan> project, Statemen
Slot innerSlot = (Slot) output.child(0);
Collection<CollectAccessPathResult> outerSlotAccessPaths = allSlotToAccessPaths.get(
output.getExprId().asInt());
allSlotToAccessPaths.putAll(innerSlot.getExprId().asInt(), outerSlotAccessPaths);
for (CollectAccessPathResult outerSlotAccessPath : outerSlotAccessPaths) {
List<String> outerPath = outerSlotAccessPath.getPath();
List<String> replaceSlotNamePath = new ArrayList<>();
replaceSlotNamePath.add(innerSlot.getName());
replaceSlotNamePath.addAll(outerPath.subList(1, outerPath.size()));
allSlotToAccessPaths.put(
innerSlot.getExprId().asInt(),
new CollectAccessPathResult(
replaceSlotNamePath,
outerSlotAccessPath.isPredicate(),
outerSlotAccessPath.getType()
)
);
}
} else {
exprCollector.collect(output);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,31 @@ public void testProject() throws Exception {
ImmutableList.of(path("s", "data", "*", "*", "b")),
ImmutableList.of()
);

createTable(
"CREATE TABLE `view_baseall_drop_nereids` (\n"
+ " `k1` int(11) NULL,\n"
+ " `k3` array<int> NULL\n"
+ " ) ENGINE=OLAP\n"
+ " DUPLICATE KEY(`k1`)\n"
+ " COMMENT 'OLAP'\n"
+ " DISTRIBUTED BY HASH(`k1`) BUCKETS 5\n"
+ " PROPERTIES (\n"
+ " \"replication_allocation\" = \"tag.location.default: 1\",\n"
+ " \"is_being_synced\" = \"false\",\n"
+ " \"storage_format\" = \"V2\",\n"
+ " \"light_schema_change\" = \"true\",\n"
+ " \"disable_auto_compaction\" = \"false\",\n"
+ " \"enable_single_replica_compaction\" = \"false\"\n"
+ " )"
);
createView("create view IF NOT EXISTS test_view7_drop_nereids (k1,k2,k3,k4) as\n"
+ " select *, array_filter(x->x>0,k3),array_filter(`k3`, array_map(x -> x > 0, `k3`)) from view_baseall_drop_nereids order by k1");
assertColumn("select * from test_view7_drop_nereids order by k1",
"array<int>",
ImmutableList.of(path("k3")),
ImmutableList.of()
);
}

@Test
Expand Down
Loading