Skip to content

Commit

Permalink
[fix](nereids) external scan use STORAGE_ANY instead of ANY as distib…
Browse files Browse the repository at this point in the history
…ution (#24039)
  • Loading branch information
englefly authored Sep 8, 2023
1 parent d8bdd6c commit c0a41dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,27 @@ public PhysicalProperties visitPhysicalEmptyRelation(PhysicalEmptyRelation empty

@Override
public PhysicalProperties visitPhysicalEsScan(PhysicalEsScan esScan, PlanContext context) {
return PhysicalProperties.ANY;
return PhysicalProperties.STORAGE_ANY;
}

@Override
public PhysicalProperties visitPhysicalFileScan(PhysicalFileScan fileScan, PlanContext context) {
return PhysicalProperties.ANY;
return PhysicalProperties.STORAGE_ANY;
}

/**
* TODO return ANY after refactor coordinator
* return STORAGE_ANY not ANY, in order to generate distribute on jdbc scan.
* select * from (select * from external.T) as A union all (select * from external.T)
* if visitPhysicalJdbcScan returns ANY, the plan is
* union
* |--- JDBCSCAN
* +--- JDBCSCAN
* this breaks coordinator assumption that one fragment has at most only one scan.
*/
@Override
public PhysicalProperties visitPhysicalJdbcScan(PhysicalJdbcScan jdbcScan, PlanContext context) {
return PhysicalProperties.ANY;
return PhysicalProperties.STORAGE_ANY;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class PhysicalJdbcScan extends PhysicalCatalogRelation {
*/
public PhysicalJdbcScan(RelationId id, TableIf table, List<String> qualifier,
Optional<GroupExpression> groupExpression, LogicalProperties logicalProperties, Set<Expression> conjuncts) {
super(id, PlanType.PHYSICAL_JDBC_SCAN, table, qualifier, groupExpression, logicalProperties);
this.conjuncts = ImmutableSet.copyOf(Objects.requireNonNull(conjuncts, "conjuncts should not be null"));
this(id, table, qualifier, groupExpression, logicalProperties,
null, null, conjuncts);
}

/**
Expand Down

0 comments on commit c0a41dc

Please sign in to comment.