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:
[email protected]


Reply via email to