support sum_int in TiFlash#10695
support sum_int in TiFlash#10695ti-chi-bot[bot] merged 3 commits intopingcap:feature/release-8.5-materialized-viewfrom
Conversation
📝 WalkthroughWalkthroughThis PR adds support for the SumInt aggregation function in TiFlash by extending aggregation handlers to recognize and process SumInt expressions, adding comprehensive test coverage, and updating Docker image registry paths with branch name sanitization in test scripts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/retest |
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
9aeb24b to
10aa386
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
dbms/src/Debug/MockExecutor/AggregationBinder.cpp (1)
205-210:⚠️ Potential issue | 🟡 Minor
SumIntshould infer output type signedness from input type, not setColumnFlagUnsignedunconditionally.In
buildAggFunc(lines 205-210),SumIntis grouped withCountandSumto set the output type toTypeLongLongwith bothColumnFlagUnsignedandColumnFlagNotNull. However, based on the return type tests indbms/src/Flash/Coprocessor/tests/gtest_sum_int_agg_func.cpp, the output signedness should match the input: summingInt64should produceInt64, notUInt64. The current unconditionalColumnFlagUnsignedis incorrect. Consider examining the input type and only setting the unsigned flag when the input type is unsigned.Additionally,
compileAggregation(lines 272–293) does not handle the"sum_int"function name in its checks. While tests currently bypass this viabuildAggFunc, adding"sum_int"to the conditions alongside"sum"would improve consistency.
🧹 Nitpick comments (2)
dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp (1)
1738-1743: Log level escalation from TRACE to DEBUG may increase log noise in production.Implicit casts are common in query processing; logging each one at DEBUG level could be verbose. If this change is a temporary debugging aid (consistent with the "[DNM] for test" PR title), consider reverting to TRACE before merging.
dbms/src/Flash/Coprocessor/tests/gtest_sum_int_agg_func.cpp (1)
37-47: Unused template parameterTExpectedOutput.
TExpectedOutputis declared but never referenced incheckSumIntReturnType. The actual verification uses string comparison. Either remove the unused parameter or use it for a type-level assertion (e.g., verifyingnested->getReturnType()matchesDataTypeNumber<TExpectedOutput>).♻️ Option A: Remove unused parameter
-template <typename TInput, typename TExpectedOutput> +template <typename TInput> void checkSumIntReturnType(const String & expected_output, const String & expected_output_nullable)Then update callers:
- checkSumIntReturnType<Int8, Int64>("Int64", "Nullable(Int64)"); + checkSumIntReturnType<Int8>("Int64", "Nullable(Int64)");
|
wait for #10721 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gengliqi, xzhangxian1008 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
dae3888
into
pingcap:feature/release-8.5-materialized-view
What problem does this PR solve?
Issue Number: close #10720
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Summary by CodeRabbit
New Features
Chores