Repository navigation
feat(rdb): 支持 countRows 选项优化非空列计数 - #125
Merged
Merged
Conversation
Member
|
自定义针对count的 FunctionFragmentBuilder 覆盖 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
为内置
count增加可选的countRows参数。目标列元数据确认为非空且countRows=true时生成count(*),优先于distinct、arg等选项;未启用或目标列可空时,沿用原有 SQL 生成逻辑。RDBFeatures.count使用继承SimpleFunctionFragmentBuilder的实现,保留字段声明类型。count仍通过原有 Feature 机制覆盖内置实现。column.option("countRows", true);旧版内置函数会忽略该选项,继续按原有选项生成 SQL。验证
countRows优先级、原有distinct/arg行为、自定义函数、旧版函数行为及 H2 方言。git diff --check:通过。zsh -lic 'java21; mvn -pl hsweb-easy-orm-rdb -am -Dtest=CountFunctionFragmentBuilderTest -Dsurefire.failIfNoSpecifiedTests=false test'。