Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](rewrite rule) Reject mismatched compare plan in PullUpJoinFromUnionAll#65472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9ae10081e22ed7eb253dd2853127c5e5bc091b571b87ad4bff5cea12b9e5064File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -198,6 +198,18 @@ public boolean equals(Object o) { | ||
| return super.equals(o) && Objects.equals(selectedPartitions, ((LogicalFileScan) o).selectedPartitions); | ||
| } | ||
| @Override | ||
| protected boolean hasSameScanState(LogicalCatalogRelation other) { | ||
morrySnow marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if (!Utils.isSameClass(this, other)) { | ||
| return false; | ||
| } | ||
| LogicalFileScan that = (LogicalFileScan) other; | ||
| return Objects.equals(selectedPartitions, that.selectedPartitions) | ||
| && Objects.equals(tableSample, that.tableSample) | ||
| && hasSameSnapshot(tableSnapshot, that.tableSnapshot) | ||
| && hasSameScanParams(scanParams, that.scanParams); | ||
| } | ||
| @Override | ||
| public List<Slot> computeOutput() { | ||
| if (cachedOutputs.isPresent()) { | ||
| @@ -266,6 +278,23 @@ public boolean supportPruneNestedColumn() { | ||
| return false; | ||
| } | ||
| private boolean hasSameSnapshot(Optional<TableSnapshot> left, Optional<TableSnapshot> right) { | ||
| if (!left.isPresent() || !right.isPresent()) { | ||
| return left.isPresent() == right.isPresent(); | ||
| } | ||
| return left.get().getType() == right.get().getType() | ||
| && Objects.equals(left.get().getValue(), right.get().getValue()); | ||
| } | ||
| private boolean hasSameScanParams(Optional<TableScanParams> left, Optional<TableScanParams> right) { | ||
| if (!left.isPresent() || !right.isPresent()) { | ||
| return left.isPresent() == right.isPresent(); | ||
| } | ||
| return Objects.equals(left.get().getParamType(), right.get().getParamType()) | ||
| && Objects.equals(left.get().getMapParams(), right.get().getMapParams()) | ||
| && Objects.equals(left.get().getListParams(), right.get().getListParams()); | ||
| } | ||
| /** | ||
| * SelectedPartitions contains the selected partitions and the total partition number. | ||
| * Mainly for hive table partition pruning. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1207,6 +1207,22 @@ public LogicalOlapScan withTableScanParams(TableScanParams scanParams) { | ||
| Optional.of(scanParams))); | ||
| } | ||
| @Override | ||
| protected boolean hasSameScanState(LogicalCatalogRelation other) { | ||
| if (!Utils.isSameClass(this, other)) { | ||
| return false; | ||
| } | ||
| LogicalOlapScan that = (LogicalOlapScan) other; | ||
| return selectedIndexId == that.selectedIndexId | ||
| && indexSelected == that.indexSelected | ||
| && Objects.equals(selectedPartitionIds, that.selectedPartitionIds) | ||
| && Objects.equals(manuallySpecifiedPartitions, that.manuallySpecifiedPartitions) | ||
| && Objects.equals(selectedTabletIds, that.selectedTabletIds) | ||
| && Objects.equals(manuallySpecifiedTabletIds, that.manuallySpecifiedTabletIds) | ||
| && Objects.equals(tableSample, that.tableSample) | ||
morrySnow marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| && hasSameScanParams(scanParams, that.scanParams); | ||
| } | ||
| @Override | ||
| public boolean supportPruneNestedColumn() { | ||
| return true; | ||
| @@ -1215,4 +1231,13 @@ public boolean supportPruneNestedColumn() { | ||
| public Optional<TableScanParams> getScanParams() { | ||
| return scanParams; | ||
| } | ||
| private boolean hasSameScanParams(Optional<TableScanParams> left, Optional<TableScanParams> right) { | ||
| if (!left.isPresent() || !right.isPresent()) { | ||
| return left.isPresent() == right.isPresent(); | ||
| } | ||
| return Objects.equals(left.get().getParamType(), right.get().getParamType()) | ||
| && Objects.equals(left.get().getMapParams(), right.get().getMapParams()) | ||
| && Objects.equals(left.get().getListParams(), right.get().getListParams()); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -21,6 +21,7 @@ | ||
| import org.apache.doris.catalog.Column; | ||
| import org.apache.doris.catalog.OlapTable; | ||
| import org.apache.doris.catalog.Table; | ||
| import org.apache.doris.catalog.constraint.TableIdentifier; | ||
| import org.apache.doris.catalog.stream.OlapTableStreamWrapper; | ||
| import org.apache.doris.catalog.stream.StreamReadMode; | ||
| import org.apache.doris.common.IdGenerator; | ||
| @@ -464,6 +465,30 @@ public LogicalOlapTableStreamScan withReadMode(StreamReadMode readMode) { | ||
| scanParams, readMode)); | ||
| } | ||
| @Override | ||
| protected boolean hasSameTableIdentity(LogicalCatalogRelation other) { | ||
| if (!Utils.isSameClass(this, other)) { | ||
| return false; | ||
| } | ||
| LogicalOlapTableStreamScan that = (LogicalOlapTableStreamScan) other; | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check other type first ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. before call this function, previous function had check class equals ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added | ||
| return Objects.equals(getTable().getStreamDbId(), that.getTable().getStreamDbId()) | ||
| && Objects.equals(getTable().getStreamId(), that.getTable().getStreamId()) | ||
| && new TableIdentifier(getTable().getBaseTable()) | ||
| .equals(new TableIdentifier(that.getTable().getBaseTable())); | ||
| } | ||
| @Override | ||
| protected boolean hasSameScanState(LogicalCatalogRelation other) { | ||
| if (!Utils.isSameClass(this, other)) { | ||
| return false; | ||
| } | ||
| LogicalOlapTableStreamScan that = (LogicalOlapTableStreamScan) other; | ||
| return super.hasSameScanState(other) | ||
| && readMode == that.readMode | ||
| && getTable().getStreamKeysType() == that.getTable().getStreamKeysType() | ||
| && Objects.equals(getTable().getOutputUpdateMap(), that.getTable().getOutputUpdateMap()); | ||
| } | ||
| @Override | ||
| public <R, C> R accept(PlanVisitor<R, C> visitor, C context) { | ||
| return visitor.visitLogicalOlapTableStreamScan(this, context); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.