liutang123 opened a new pull request, #68452:
URL: https://github.com/apache/doris/pull/68452

   ### What problem does this PR solve?
   
   Problem Summary:
   
   `SELECT max(dt) FROM hive_tbl` (and the `dt = (SELECT max(dt) FROM ...)` 
latest-partition pattern) currently scans the whole table although the answer 
is already in the partition metadata. Add PARTITION_VALUE pushdown: the scan 
emits one row of partition column values per data file without opening any file.
   
   Changes, in order:
   
   1. gensrc: add `TPushAggOp.PARTITION_VALUE`.
   2. BE: add `PartitionColumnReader` and install it in `FileScanner` when 
every requested column is a partition column.
   3. FE: add session variable 
`enable_partition_column_value_only_optimization` (default true).
   4. FE: add the two `AggregateStrategies` rules plus the PARTITION_VALUE 
helpers, including the two rules that cross a `LogicalFilter`.
   5. FE: treat a CTE producer/consumer, `PartitionTopN` and a no-group-by 
aggregate as effective runtime-filter sources, so the runtime filter is not 
pruned away.
   6. FE: add `ConnectorCapability.SUPPORTS_PARTITION_VALUE_ONLY` (HIVE/HUDI 
only) and plumb `ConnectorScanRequest.partitionValuePushdown`, so Hive stops 
splitting files for this scan.
   
   ### Release note
   
   New session variable `enable_partition_column_value_only_optimization` 
(default true): a min/max aggregation over only Hive/Hudi partition columns is 
answered from partition metadata without reading data files.
   
   ### Check List (For Author)
   
   - Test: No need to test (with reason) — not run yet: the local FE build 
fails on a pre-existing thrift version mismatch (thrift 0.16.0 vs libthrift 
0.24.0) and BE was not compiled. Regression tests still to be added.
   - Behavior changed: Yes — see the release note; gated by the new session 
variable.
   - Does this need documentation: No
   
   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
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]

Reply via email to