Issue 1:
sharding-proxy version:4.0.0

I insert some rows to sharding-proxy by my custom hash algorithm.

person_id
name
last_update_time
account
which data node

174fd27ef0f34fd5b9296f102ffdbd47
liuqiang
2020-02-12 20:47:10
3
ds_0

4295029899a64d1bbfc5b4d37b628f0c
wangwu
2020-02-12 20:28:22
2
ds_0

a672ba34d2f14f4d8e3ee9e8ccfd6ca5
liyi
2020-02-12 20:47:16
1
ds_0

bf840dc0eaf64f7a8a7493c3ffea8799
huangyao
2020-02-12 20:28:38
3
ds_0

c63b749e981a4dc6b4942b18978e0d08
lisi
2020-02-12 20:28:17
2
ds_0

e28da7bc9ddc45bdb2974041ed564fc3
zhangsan
2020-02-12 20:27:48
1
ds_0

f741d4fb69f14b869dac11e2889fe8c1
penggang
2020-02-12 20:28:34
3
ds_0

0596342115c14328b2b0458d0860a90c
lingang
2020-02-12 20:28:47
3
ds_1

2f8b95104c114cc5a8ab6bc86ef9ab62
luyang
2020-02-12 20:28:50
2
ds_1

4397392fb6274bf2bfcfc41ae1da55a5
tangliang
2020-02-12 20:28:42
1
ds_1

c57c358c49cc4da6b98477ad8a55db3f
help
2020-02-13 16:01:28
3
ds_1

d9edd130ab8241f6be4b96a12cdb0404
zhaoliu
2020-02-12 20:28:26
2
ds_1

f97ea21d03124aa8b59a23bad5585e81
wanger
2020-02-12 20:28:29
1
ds_1

then,I execute this SQL:

select distinct account from tbperson;

result is :

account

3

2

1

3

2

1

right result gonna be:

account

3

2

1

look forward to your reply.

Issue 2:
Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Searched open and closed GitHub issues.

Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details.

If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

5.0.0-RC1-SNAPSHOT

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

Execute SQL correctly:

select tranlist_dcdir,sum(tranlist_bale) as tranlist_total from tranlist group by tranlist_dcdir;

Actual behavior

[INFO ] 2021-03-31 16:36:15.583 [ShardingSphere-Command-3] ShardingSphere-SQL - Logic SQL: select tranlist_dcdir,sum(tranlist_bale) as tranlist_total from tranlist group by tranlist_dcdir;
[INFO ] 2021-03-31 16:36:15.583 [ShardingSphere-Command-3] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty)
[INFO ] 2021-03-31 16:36:15.583 [ShardingSphere-Command-3] ShardingSphere-SQL - Actual SQL: ds_0 ::: select tranlist_dcdir,sum(tranlist_bale) as tranlist_total from tranlist group by tranlist_dcdir;
[ERROR] 2021-03-31 16:36:15.667 [ShardingSphere-Command-3] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
java.lang.IllegalStateException: Can not find owner from table.
at org.apache.shardingsphere.infra.binder.segment.table.TablesContext.findTableNameFromSQL(TablesContext.java:118)
at org.apache.shardingsphere.infra.binder.segment.table.TablesContext.findTableName(TablesContext.java:85)
at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditionValueMap(WhereClauseShardingConditionEngine.java:104)
at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:87)
at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.lambda$createShardingConditions$0(WhereClauseShardingConditionEngine.java:72)
at java.util.Optional.ifPresent(Optional.java:159)
at org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:72)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createShardingConditions(ShardingSQLRouter.java:71)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:56)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:47)
at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:62)
at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:52)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.execute(DatabaseCommunicationEngine.java:93)
at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:55)
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:57)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).