peilinqian opened a new issue, #20978:
URL: https://github.com/apache/shardingsphere/issues/20978
### Which version of ShardingSphere did you use?
we find java version: java8, full_version=1.8.0_342,
full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java
ShardingSphere-5.2.1-SNAPSHOT
Commit ID: dirty-f44e5d3c09a38139dbb2e1b0548816aa572ccc3c
Commit Message: Release 5.2.0 and prepare for next development iteration
(#20886)
Branch: f44e5d3c09a38139dbb2e1b0548816aa572ccc3c
Build time: 2022-09-13T11:31:41+0800
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
Create a view for the sharded table successfully
### Actual behavior
Create a view for the sharded table successfully,actual view name is wrong
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
```
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - Logic SQL: create view t_ssdb_tb_view as select * from
t_ssdb_tb;
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - SQLStatement:
OpenGaussCreateViewStatement(super=CreateViewStatement(super=AbstractSQLStatement(parameterCount=0,
parameterMarkerSegments=[], commentSegments=[]),
view=SimpleTableSegment(tableName=TableNameSegment(startIndex=12, stopIndex=25,
identifier=IdentifierValue(value=t_ssdb_tb_view, quoteCharacter=NONE)),
owner=Optional.empty, alias=Optional.empty),
select=Optional[OpenGaussSelectStatement(super=SelectStatement(super=AbstractSQLStatement(parameterCount=0,
parameterMarkerSegments=[], commentSegments=[]),
projections=ProjectionsSegment(startIndex=37, stopIndex=37,
projections=[ShorthandProjectionSegment(startIndex=37, stopIndex=37,
owner=Optional.empty, alias=Optional.empty)], distinctRow=false),
from=SimpleTableSegment(tableName=TableNameSegment(startIndex=44, stopIndex=52,
identifier=IdentifierValue(value=t_ssdb_tb, quoteCharacter=NONE)),
owner=Optional.empty, alias=Optional.empty), where=Op
tional.empty, groupBy=Optional.empty, having=Optional.empty,
orderBy=Optional.empty, combines=[]), limit=Optional.empty,
lock=Optional.empty, window=Optional.empty)]))
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - Actual SQL: write_0 ::: create view t_ssdb_tb_view_new_0
as select * from t_ssdb_tb_0;
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - Actual SQL: write_0 ::: create view t_ssdb_tb_view_new_1
as select * from t_ssdb_tb_1;
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - Actual SQL: write_1 ::: create view t_ssdb_tb_view_new_0
as select * from t_ssdb_tb_0;
[INFO ] 2022-09-14 16:37:46.297 [Connection-3-ThreadExecutor]
ShardingSphere-SQL - Actual SQL: write_1 ::: create view t_ssdb_tb_view_new_1
as select * from t_ssdb_tb_1;
```
### Example codes for reproduce this issue (such as a github link).
```
rules:
- !SHARDING
tables:
t_ssdb_tb:
actualDataNodes: ds_${0..1}.t_ssdb_tb_${0..1}
databaseStrategy:
standard:
shardingAlgorithmName: ds_database_inline
shardingColumn: id
tableStrategy:
standard:
shardingColumn: c_id
shardingAlgorithmName: ts_t_ssdb_tb_inline
t_ssdb_tb_view:
actualDataNodes: ds_${0..1}.t_ssdb_tb_view_${0..1}
databaseStrategy:
standard:
shardingAlgorithmName: ds_database_inline
shardingColumn: id
tableStrategy:
standard:
shardingColumn: c_id
shardingAlgorithmName: ts_t_ssdb_tb_view_inline
t_ssdb_tb_view_new:
actualDataNodes: ds_${0..1}.t_ssdb_tb_view_new_${0..1}
databaseStrategy:
standard:
shardingAlgorithmName: ds_database_inline
shardingColumn: id
tableStrategy:
standard:
shardingColumn: c_id
shardingAlgorithmName: ts_t_ssdb_tb_view_new_inline
defaultTableStrategy:
none:
defaultDatabaseStrategy:
none:
shardingAlgorithms:
ds_database_inline:
type: INLINE
props:
algorithm-expression: ds_${id % 2}
allow-range-query-with-inline-sharding: true
ts_t_ssdb_tb_inline:
type: INLINE
props:
algorithm-expression: t_ssdb_tb_${c_id % 2}
allow-range-query-with-inline-sharding: true
ts_t_ssdb_tb_view_inline:
type: INLINE
props:
algorithm-expression: t_ssdb_tb_view_${c_id % 2}
allow-range-query-with-inline-sharding: true
ts_t_ssdb_tb_view_new_inline:
type: INLINE
props:
algorithm-expression: t_ssdb_tb_view_new_${c_id % 2}
allow-range-query-with-inline-sharding: true
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]