Skip to content

Conversation

@miomiocat
Copy link
Contributor

What type of PR is this:

  • bug
  • feature
  • enhancement
  • others

Which issues of this PR fixes :

Closes #4753

Problem Summary(Required) :

Fix the wrong result when partition columns exists in where statements

return scanColumns.size() != 0 && !((LogicalHiveScanOperator) scanOperator).getPartitionColumns().containsAll(
scanColumns.stream().map(ColumnRefOperator::getName).collect(Collectors.toList()));
}
if (scanOperator instanceof LogicalHudiScanOperator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely need our DLA new framework to not let this duplicated code exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is necessary and more abstract operaters should be extracted to decouple from concrete table properties.

Make a rough refinement about this here, PTAL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely need our DLA new framework to not let this duplicated code exist.

that's true we should have a common prune rule which call api of connectors

dirtysalt
dirtysalt previously approved these changes Apr 15, 2022
imay
imay previously approved these changes Apr 15, 2022
@miomiocat miomiocat dismissed stale reviews from imay and dirtysalt via 52a63f8 April 15, 2022 09:08
@miomiocat
Copy link
Contributor Author

run starrocks_fe_unittest

1 similar comment
@miomiocat
Copy link
Contributor Author

run starrocks_fe_unittest

private boolean containsMaterializedColumn(LogicalScanOperator scanOperator, Set<ColumnRefOperator> scanColumns) {
if (scanOperator instanceof LogicalHiveScanOperator) {
return scanColumns.size() != 0 && !((LogicalHiveScanOperator) scanOperator).getPartitionColumns().containsAll(
if (scanOperator instanceof LogicalHiveScanOperator || scanOperator instanceof LogicalHudiScanOperator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add this check logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

if (scanOperator instanceof LogicalHudiScanOperator) {
// Hudi partition columns is not materialized column, so except partition columns
return ((LogicalHudiScanOperator) scanOperator).getPartitionColumns().contains(columnName);
if (scanOperator instanceof LogicalHiveScanOperator || scanOperator instanceof LogicalHudiScanOperator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Contributor

@caneGuy caneGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dirtysalt dirtysalt merged commit e12dea3 into StarRocks:main Apr 18, 2022
@miomiocat
Copy link
Contributor Author

@Mergifyio backport branch-2.2

mergify bot pushed a commit that referenced this pull request Apr 19, 2022
@mergify
Copy link
Contributor

mergify bot commented Apr 19, 2022

backport branch-2.2

✅ Backports have been created

Details

@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage check]

😍 pass : 7 / 7 (100.00%)

file detail

path covered line new line coverage
🔵 com/starrocks/sql/optimizer/operator/logical/LogicalScanOperator.java 2 2 100.00%
🔵 com/starrocks/sql/optimizer/rule/transformation/PruneHDFSScanColumnRule.java 3 3 100.00%
🔵 com/starrocks/sql/optimizer/operator/logical/LogicalHudiScanOperator.java 2 2 100.00%

caneGuy pushed a commit that referenced this pull request Apr 19, 2022
@miomiocat miomiocat deleted the fix-orc branch April 19, 2022 11:29
blackstar-baba pushed a commit to blackstar-baba/starrocks that referenced this pull request Apr 28, 2022
ABingHuang pushed a commit to ABingHuang/starrocks that referenced this pull request Apr 29, 2022
imay pushed a commit that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <[email protected]>
(cherry picked from commit 8c46037)

Co-authored-by: 絵空事スピリット <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

result error from hudi external table with orc file system

5 participants