[Bug](function) add ndv decimalv2 support#61546
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Pull request overview
Adds backend support for ndv/approx_count_distinct over DECIMALV2 inputs and extends the Nereids regression suite to validate the behavior.
Changes:
- Enable
approx_count_distinct/ndvforTYPE_DECIMALV2in BE aggregate function factory registration. - Add a Nereids regression query
select ndv(c2)for adecimalv2column and update the expected output accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| regression-test/suites/nereids_p0/datatype/test_decimalv2.groovy | Adds a regression assertion for ndv(decimalv2) on a small dataset. |
| regression-test/data/nereids_p0/datatype/test_decimalv2.out | Updates golden output to include the new ndv result (and regenerated decimalv2 display formatting). |
| be/src/exprs/aggregate/aggregate_function_approx_count_distinct.cpp | Registers TYPE_DECIMALV2 as an allowed argument type for approx_count_distinct/ndv. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
This pull request focuses on improving support for the `DECIMALV2` data type in aggregate functions and updating related regression tests to ensure correctness. The most important changes are grouped below: ### Aggregate Function Support * Added `TYPE_DECIMALV2` to the supported types for the `approx_count_distinct` aggregate function in `aggregate_function_approx_count_distinct.cpp`, enabling this function to work with `DECIMALV2` columns. ### Regression Test Enhancements * Updated the output in `test_decimalv2.out` to reflect higher precision for `DECIMALV2` values, showing results with more decimal places to match the new behavior. * Added a new test case in `test_decimalv2.groovy` to verify the correct behavior of the `ndv` (number of distinct values) aggregate function on `DECIMALV2` columns.
This pull request focuses on improving support for the `DECIMALV2` data type in aggregate functions and updating related regression tests to ensure correctness. The most important changes are grouped below: ### Aggregate Function Support * Added `TYPE_DECIMALV2` to the supported types for the `approx_count_distinct` aggregate function in `aggregate_function_approx_count_distinct.cpp`, enabling this function to work with `DECIMALV2` columns. ### Regression Test Enhancements * Updated the output in `test_decimalv2.out` to reflect higher precision for `DECIMALV2` values, showing results with more decimal places to match the new behavior. * Added a new test case in `test_decimalv2.groovy` to verify the correct behavior of the `ndv` (number of distinct values) aggregate function on `DECIMALV2` columns.
This pull request focuses on improving support for the
DECIMALV2data type in aggregate functions and updating related regression tests to ensure correctness. The most important changes are grouped below:Aggregate Function Support
TYPE_DECIMALV2to the supported types for theapprox_count_distinctaggregate function inaggregate_function_approx_count_distinct.cpp, enabling this function to work withDECIMALV2columns.Regression Test Enhancements
test_decimalv2.outto reflect higher precision forDECIMALV2values, showing results with more decimal places to match the new behavior.test_decimalv2.groovyto verify the correct behavior of thendv(number of distinct values) aggregate function onDECIMALV2columns.