-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Only Use Hint to shard switch database,with not sqlParse #4806
Comments
#4478 now i have 141 tables。。。。 |
Every SQL need to pass SQL parser engine. |
Answer is yes. |
The answer was timely if every table must be config,if not config then exception。 is this the same question with upper question ? SELECT DISTINCT |
Version
5.0.0-RC1-SNAPSHOT from master branch
Question
I used hint as a database rule.
But does the SQL statement still have to execute the sqlparse call? I just want to use hint to perform sub database operations. My statements have some associated retrieval or more complex statistical statements. Sqlparse is not well supported.
Of course, the release version may support it, but I don't want to witre many table config,Most tables only need to be sharding into databases
What can I do to tell shardingsphere not to parse it? Just access the specified database according to my hint rules.
or is there have some simple configuration writing methods to only shard with db and with not table?
my config is:
dataSources:
#names: master,test
master: !!com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/wise-master?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
password: J
#filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
#
filters: stat,wall,slf4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500;druid.stat.logSlowSql=true
test: !!com.alibaba.druid.pool.DruidDataSource
#type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/wise-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
password: J
test2: !!com.alibaba.druid.pool.DruidDataSource
#type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/wise-test2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
password: J
shardingRule:
tables:
v_s_biz_fee: #TODO saas
databaseStrategy:
hint: #Hint
algorithmClassName: com.smarttree.manage.config.mybatis.HintShardingStrategy
v_s_official_notice: #TODO saas
databaseStrategy:
hint: #Hint
algorithmClassName: com.smarttree.manage.config.mybatis.HintShardingStrategy
act_ru_history_job:
databaseStrategy:
hint: #Hint
algorithmClassName: com.smarttree.manage.config.mybatis.HintShardingStrategy
act_ru_identitylink:
databaseStrategy:
hint: #Hint
algorithmClassName: com.smarttree.manage.config.mybatis.HintShardingStrategy
........
many tables with Hint
sys_area:
actualDataNodes: master.sys_area
databaseStrategy:
none: #Hint
sys_area_cn:
actualDataNodes: master.sys_area_cn
databaseStrategy:
none: #Hint
sys_tenant_info:
actualDataNodes: master.sys_tenant_info
databaseStrategy:
none: #Hint
sys_column_define:
actualDataNodes: master.sys_column_define
databaseStrategy:
none: #Hint
mst_cpc_info:
actualDataNodes: master.mst_cpc_info
defaultDataSourceName: master
defaultDatabaseStrategy:
hint: #Hint
algorithmClassName: com.smarttree.manage.config.mybatis.HintShardingStrategy
bindingTables:
- quartz_user_monitor,qrtz_triggers
- qrtz_job_details,qrtz_fired_triggers
props:
sql.show: true
The text was updated successfully, but these errors were encountered: