You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/01/25 11:53:08 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

tristaZero opened a new issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152


   Hi, community,
   
   This is a little complex issue to add unit test for `SQL federation` when encrypt rule, replicaQuery rule and sharding rule all exist.
   
   ### Target files
   CalciteStatementTest and CalcitePrepareStatementTest
   
   ### How
   - Understand `encrypt rule`, `replicaQuery rule` and `sharding rule` (Rule examples in `shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config` or `examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF`)
   - Provide a mix rule configuration with `encrypt rule`, `replicaQuery rule` and `sharding rule` (A single table with an encrypted column, a sharding table with an encrypted column and a simple single table)
   - Add a test `join` SQL for a single table with an encrypted column and a simple single table in target files
   - Add a test `join` SQL for a sharding table with encrypted column and a simple single table in target files


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lmhmhl commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
lmhmhl commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-766768778


   I wanna have a try. Thx.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lmhmhl commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
lmhmhl commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-768236481


   Hi @tristaZero.
   I have configured my `yml` file, but I encountered some troubles, I check my `yml` many times, and rewrite it, but it still doesn't work. I would be very glad if you can give me some advice. 
   
   ```
   rules:
   - !SHARDING
     tables:
       t_order_item_calcite_sharding:
         actualDataNodes: calcite_ds.t_order_item_calcite_sharding_${0..1}
         tableStrategy:
           standard:
             shardingColumn: item_id
             shardingAlgorithmName: table_inline
       t_user_encrypt_calcite:
         actualDataNodes: calcite_ds.t_user_encrypt_calcite{0..1}
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
       t_user_encrypt_calcite_sharding:
         actualDataNodes: calcite_ds.t_user_encrypt_calcite_sharding${0..1}
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
         tableStrategy:
           shardingStrategy:
             standard:
               shardingColumn: id
               shardingAlgorithmName: mod
     shardingAlgorithms:
       table_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_calcite_sharding_${item_id % 2}
       mod:
         type: MOD
         props:
           sharding-count: 2
     dataSources:
       test_ds:
         name: calcite_ds
         primaryDataSourceName: calcite_jdbc_1
         replicaDataSourceNames: calcite_jdbc_2
         loadBalancerName: roundRobin
       loadBalancers:
         roundRobin:
           type: ROUND_ROBIN
   props:
     sql-show: true
     query-with-cipher-column: true
   ```
   ```
   Test ignored.
   
   
   
   Cannot create property=rules for JavaBean=org.apache.shardingsphere.infra.yaml.config.YamlRootRuleConfigurations@6f45df59
    in 'reader', line 18, column 1:
       rules:
       ^
   Cannot create property=tables for JavaBean=org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration@58ea606c
    in 'reader', line 19, column 3:
       - !SHARDING
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
    in 'reader', line 21, column 5:
           t_order_item_calcite_sharding:
           ^
   
    in 'reader', line 19, column 1:
       - !SHARDING
       ^
   
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:345)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127)
   	at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450)
   	at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:410)
   	at org.apache.shardingsphere.infra.yaml.engine.YamlEngine.unmarshal(YamlEngine.java:61)
   	at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:79)
   	at org.apache.shardingsphere.driver.jdbc.base.AbstractShardingSphereDataSourceForCalciteTest.initCalciteDataSource(AbstractShardingSphereDataSourceForCalciteTest.java:54)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
   	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
   	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
   	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
   	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
   	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
   	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
   	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
   Caused by: Cannot create property=tables for JavaBean=org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration@58ea606c
    in 'reader', line 19, column 3:
       - !SHARDING
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
    in 'reader', line 21, column 5:
           t_order_item_calcite_sharding:
           ^
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:345)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:275)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:246)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructSequence.construct(Constructor.java:536)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:297)
   	... 25 more
   Caused by: Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:373)
   	at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:147)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:354)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:170)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:297)
   	... 33 more
   Caused by: org.yaml.snakeyaml.error.YAMLException: Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
   	at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:132)
   	at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:121)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.getProperty(Constructor.java:322)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:240)
   	... 41 more
   
   
   
   Process finished with exit code 255
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-774579200


   Done.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lmhmhl removed a comment on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
lmhmhl removed a comment on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-768236481


   Hi @tristaZero.
   I have configured my `yml` file, but I encountered some troubles, I check my `yml` many times, and rewrite it, but it still doesn't work. I would be very glad if you can give me some advice. 
   
   ```
   rules:
   - !SHARDING
     tables:
       t_order_item_calcite_sharding:
         actualDataNodes: calcite_ds.t_order_item_calcite_sharding_${0..1}
         tableStrategy:
           standard:
             shardingColumn: item_id
             shardingAlgorithmName: table_inline
       t_user_encrypt_calcite:
         actualDataNodes: calcite_ds.t_user_encrypt_calcite{0..1}
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
       t_user_encrypt_calcite_sharding:
         actualDataNodes: calcite_ds.t_user_encrypt_calcite_sharding${0..1}
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
         tableStrategy:
           shardingStrategy:
             standard:
               shardingColumn: id
               shardingAlgorithmName: mod
     shardingAlgorithms:
       table_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_calcite_sharding_${item_id % 2}
       mod:
         type: MOD
         props:
           sharding-count: 2
     dataSources:
       test_ds:
         name: calcite_ds
         primaryDataSourceName: calcite_jdbc_1
         replicaDataSourceNames: calcite_jdbc_2
         loadBalancerName: roundRobin
       loadBalancers:
         roundRobin:
           type: ROUND_ROBIN
   props:
     sql-show: true
     query-with-cipher-column: true
   ```
   ```
   Test ignored.
   
   
   
   Cannot create property=rules for JavaBean=org.apache.shardingsphere.infra.yaml.config.YamlRootRuleConfigurations@6f45df59
    in 'reader', line 18, column 1:
       rules:
       ^
   Cannot create property=tables for JavaBean=org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration@58ea606c
    in 'reader', line 19, column 3:
       - !SHARDING
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
    in 'reader', line 21, column 5:
           t_order_item_calcite_sharding:
           ^
   
    in 'reader', line 19, column 1:
       - !SHARDING
       ^
   
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:345)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127)
   	at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450)
   	at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:410)
   	at org.apache.shardingsphere.infra.yaml.engine.YamlEngine.unmarshal(YamlEngine.java:61)
   	at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:79)
   	at org.apache.shardingsphere.driver.jdbc.base.AbstractShardingSphereDataSourceForCalciteTest.initCalciteDataSource(AbstractShardingSphereDataSourceForCalciteTest.java:54)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
   	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
   	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
   	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
   	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
   	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
   	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
   	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
   Caused by: Cannot create property=tables for JavaBean=org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration@58ea606c
    in 'reader', line 19, column 3:
       - !SHARDING
         ^
   Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
    in 'reader', line 21, column 5:
           t_order_item_calcite_sharding:
           ^
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:345)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:275)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:246)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructSequence.construct(Constructor.java:536)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:297)
   	... 25 more
   Caused by: Cannot create property=columns for JavaBean=org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration@5c90e579
    in 'reader', line 28, column 7:
             actualDataNodes: calcite_ds.t_us ... 
             ^
   Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
    in 'reader', line 30, column 9:
               pwd:
               ^
   
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:312)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:373)
   	at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:147)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:354)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:170)
   	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:297)
   	... 33 more
   Caused by: org.yaml.snakeyaml.error.YAMLException: Unable to find property 'columns' on class: org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration
   	at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:132)
   	at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:121)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.getProperty(Constructor.java:322)
   	at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:240)
   	... 41 more
   
   
   
   Process finished with exit code 255
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lmhmhl commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
lmhmhl commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-766768778


   I wanna have a try. Thx.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-769762104


   Hi @lmhmhl ,
   
   ShardingSphere has the capacity to handle sharding, encryption, replicaQuery scenarios together. I know it is a little hard to understand, but this issue is still an excellent way to help you learn more about this project.
   
   Let us simplify this job firstly. Do you think it is possible to prepare a `sharding-replica-query.yaml` to cover sharding and replicaQuery scenario for SQL federation? (FYI. `examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/resources/META-INF/sharding-replica-query.yaml`)
   
   Have a good weekend. :)


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lmhmhl commented on issue #9152: [SQL federation] Add unit test when encrypt rule, replicaQuery rule and sharding rule all exist

Posted by GitBox <gi...@apache.org>.
lmhmhl commented on issue #9152:
URL: https://github.com/apache/shardingsphere/issues/9152#issuecomment-768834533


   Hi @tristaZero.
   Honestly, I don't know how to configure the yml file, specifically, I don't know how to combine the sharding rule, and encrypt rule in one table.  It seems that It doesn't work like following code snippet , and I look up all the examples, and there are no yml file consist of the combination of sharding rule and encrypt rule, so I am wondering what does the yml file should looks like, can you give me some hints? By the way, I have read the doc of SS carefully, and found that It may not support mix sharding rule and encrypt rule, is this a new feature of SS?
   
   <img width="890" alt="Screen Shot 2021-01-28 at 2 34 11 PM" src="https://user-images.githubusercontent.com/24718258/106099699-11f16500-6176-11eb-9322-6b7f86fb850c.png">
   
   ```
   rules:
   - !SHARDING
     tables:
       t_order_item_calcite_sharding:
         actualDataNodes: calcite_ds.t_order_item_calcite_sharding_${0..1}
         tableStrategy:
           standard:
             shardingColumn: item_id
             shardingAlgorithmName: table_inline
   - !ENCRYPT, !SHARDING
     encryptors:
       test:
         type: test
     tables:
       t_user_encrypt_calcite:
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
       t_user_encrypt_calcite_sharding:
         columns:
           pwd:
             plainColumn: plain_pwd
             cipherColumn: cipher_pwd
             assistedQueryColumn: assist_pwd
             encryptorName: test
         actualDataNodes: calcite_ds.t_user_encrypt_calcite_sharding_${0..1}
         tableStrategy:
           shardingStrategy:
             standard:
               shardingColumn: id
               shardingAlgorithmName: mod
     shardingAlgorithms:
       table_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_calcite_sharding_${item_id % 2}
       mod:
         type: MOD
         props:
           sharding-count: 2
   
   - !REPLICA_QUERY
     dataSources:
       calcite_ds:
         name: calcite_ds
         primaryDataSourceName: calcite_jdbc_1
         replicaDataSourceNames: calcite_jdbc_2
         loadBalancerName: roundRobin
     loadBalancers:
       roundRobin:
         type: ROUND_ROBIN
   
   props:
     sql-show: true
     query-with-cipher-column: 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org