seawinde commented on code in PR #29227:
URL: https://github.com/apache/doris/pull/29227#discussion_r1437938662
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/mapping/RelationMapping.java:
##########
@@ -59,54 +61,84 @@ public static RelationMapping
of(ImmutableBiMap<MappedRelation, MappedRelation>
*/
public static List<RelationMapping> generate(List<CatalogRelation>
sources, List<CatalogRelation> targets) {
// Construct tmp map, key is the table qualifier, value is the
corresponding catalog relations
- LinkedListMultimap<Long, MappedRelation> sourceTableRelationIdMap =
LinkedListMultimap.create();
+ HashMultimap<Long, MappedRelation> sourceTableRelationIdMap =
HashMultimap.create();
for (CatalogRelation relation : sources) {
sourceTableRelationIdMap.put(getTableQualifier(relation.getTable()),
MappedRelation.of(relation.getRelationId(), relation));
}
- LinkedListMultimap<Long, MappedRelation> targetTableRelationIdMap =
LinkedListMultimap.create();
+ HashMultimap<Long, MappedRelation> targetTableRelationIdMap =
HashMultimap.create();
for (CatalogRelation relation : targets) {
targetTableRelationIdMap.put(getTableQualifier(relation.getTable()),
MappedRelation.of(relation.getRelationId(), relation));
}
Set<Long> sourceTableKeySet = sourceTableRelationIdMap.keySet();
- List<List<Pair<MappedRelation, MappedRelation>>> mappedRelations = new
ArrayList<>();
+ List<List<RelationMapping>> mappedRelations = new ArrayList<>();
Review Comment:
I try to use ImmutableEquivalenceSet, i found that `ImmutableEquivalenceSet`
may be not suit the scene
such as I want to make a relation mapping as
`RelationId#1 -> RelationId#2` which should keep the directivity。
after call` ImmutableEquivalenceSet.addEqualPair` then `tryToMap`,i found
get the result
is
> RelationId#1 -> RelationId#2
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/mapping/RelationMapping.java:
##########
@@ -59,54 +61,84 @@ public static RelationMapping
of(ImmutableBiMap<MappedRelation, MappedRelation>
*/
public static List<RelationMapping> generate(List<CatalogRelation>
sources, List<CatalogRelation> targets) {
// Construct tmp map, key is the table qualifier, value is the
corresponding catalog relations
- LinkedListMultimap<Long, MappedRelation> sourceTableRelationIdMap =
LinkedListMultimap.create();
+ HashMultimap<Long, MappedRelation> sourceTableRelationIdMap =
HashMultimap.create();
for (CatalogRelation relation : sources) {
sourceTableRelationIdMap.put(getTableQualifier(relation.getTable()),
MappedRelation.of(relation.getRelationId(), relation));
}
- LinkedListMultimap<Long, MappedRelation> targetTableRelationIdMap =
LinkedListMultimap.create();
+ HashMultimap<Long, MappedRelation> targetTableRelationIdMap =
HashMultimap.create();
for (CatalogRelation relation : targets) {
targetTableRelationIdMap.put(getTableQualifier(relation.getTable()),
MappedRelation.of(relation.getRelationId(), relation));
}
Set<Long> sourceTableKeySet = sourceTableRelationIdMap.keySet();
- List<List<Pair<MappedRelation, MappedRelation>>> mappedRelations = new
ArrayList<>();
+ List<List<RelationMapping>> mappedRelations = new ArrayList<>();
Review Comment:
I try to use ImmutableEquivalenceSet, i found that `ImmutableEquivalenceSet`
may be not suit the scene
such as I want to make a relation mapping as
`RelationId#1 -> RelationId#2` which should keep the directivity。
after call` ImmutableEquivalenceSet.addEqualPair` then `tryToMap`,i found
get the result
is
> RelationId#2 -> RelationId#1
--
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]