Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能支持一下修改 SELECT_COUNT = "select count(*) as count from "吗 #2

Closed
masankin opened this issue Oct 14, 2019 · 2 comments
Closed

Comments

@masankin
Copy link

sharding-sphere分库分表查询时碰到select count() from问题:
Caused by: java.lang.IllegalStateException: Can't find index: AggregationSelectItem(type=COUNT, innerExpression=(
), alias=Optional.absent(), derivedAggregationItems=[], index=-1), please add alias for aggregate selections

于是使用countQuery重写为 select count() as count 结果正常
考虑到 com.blinkfox.fenix.jpa.FenixJpaQuery.getCountSql 可替换 select count(
)
SELECT_COUNT = "select count(*) as count from " 考虑看能否支持一下

@blinkfox
Copy link
Owner

@masankin 可以,今天或明天应该可以发一版出来。

@blinkfox
Copy link
Owner

@masankin 昨天改了默认求 count 时加 as 别名的功能,发了 v1.1.1版本,你试用下,没啥问题就关掉这个 issue

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

No branches or pull requests

2 participants