tristaZero commented on a change in pull request #9249:
URL: https://github.com/apache/shardingsphere/pull/9249#discussion_r568295546



##########
File path: 
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-calcite.yaml
##########
@@ -23,10 +23,54 @@ rules:
         tableStrategy:
           standard:
             shardingColumn: item_id
-            shardingAlgorithmName: table_inline
+            shardingAlgorithmName: table_inline_item_id
+      t_user_encrypt_calcite_sharding:
+        actualDataNodes: calcite_jdbc_1.t_user_encrypt_calcite_sharding_${0..1}

Review comment:
       > calcite_jdbc_1.t_user_encrypt_calcite_sharding_${0..1}
   
   It is supposed to be `calcite_ds.t_user_encrypt_calcite_sharding_${0..1}` to 
leverage `replicaQuery` power.

##########
File path: 
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-calcite.yaml
##########
@@ -23,10 +23,54 @@ rules:
         tableStrategy:
           standard:
             shardingColumn: item_id
-            shardingAlgorithmName: table_inline
+            shardingAlgorithmName: table_inline_item_id
+      t_user_encrypt_calcite_sharding:
+        actualDataNodes: calcite_jdbc_1.t_user_encrypt_calcite_sharding_${0..1}
+        tableStrategy:
+          standard:
+            shardingColumn: user_id
+            shardingAlgorithmName: table_inline_user_id
     shardingAlgorithms:
-      table_inline:
+      table_inline_item_id:
         type: INLINE
         props:
           algorithm-expression: t_order_item_calcite_sharding_${item_id % 2}
+      table_inline_user_id:
+        type: INLINE
+        props:
+          algorithm-expression: t_user_encrypt_calcite_sharding_${user_id % 2}
+  - !ENCRYPT
+    encryptors:
+      encryptor_aes:
+        type: aes
+        props:
+          aes-key-value: 123456abc
+    tables:
+      t_user_encrypt_calcite:
+        columns:
+          pwd:
+            plainColumn: plain_pwd
+            cipherColumn: cipher_pwd
+            encryptorName: encryptor_aes
+      t_user_encrypt_calcite_sharding:
+        columns:
+          pwd:
+            plainColumn: plain_pwd
+            cipherColumn: cipher_pwd
+            encryptorName: encryptor_aes
+  - !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: false

Review comment:
       Could we set `query-with-cipher-column` = `true` to indeed examine 
whether this SQL federation feature can work well with the encryption rule?

##########
File path: 
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-calcite.yaml
##########
@@ -23,10 +23,54 @@ rules:
         tableStrategy:
           standard:
             shardingColumn: item_id
-            shardingAlgorithmName: table_inline
+            shardingAlgorithmName: table_inline_item_id
+      t_user_encrypt_calcite_sharding:
+        actualDataNodes: calcite_jdbc_1.t_user_encrypt_calcite_sharding_${0..1}
+        tableStrategy:
+          standard:
+            shardingColumn: user_id
+            shardingAlgorithmName: table_inline_user_id
     shardingAlgorithms:
-      table_inline:
+      table_inline_item_id:
         type: INLINE
         props:
           algorithm-expression: t_order_item_calcite_sharding_${item_id % 2}
+      table_inline_user_id:
+        type: INLINE
+        props:
+          algorithm-expression: t_user_encrypt_calcite_sharding_${user_id % 2}
+  - !ENCRYPT
+    encryptors:
+      encryptor_aes:
+        type: aes
+        props:
+          aes-key-value: 123456abc
+    tables:
+      t_user_encrypt_calcite:
+        columns:
+          pwd:
+            plainColumn: plain_pwd
+            cipherColumn: cipher_pwd
+            encryptorName: encryptor_aes
+      t_user_encrypt_calcite_sharding:
+        columns:
+          pwd:
+            plainColumn: plain_pwd
+            cipherColumn: cipher_pwd
+            encryptorName: encryptor_aes
+  - !REPLICA_QUERY
+    dataSources:
+      calcite_ds:
+        name: calcite_ds
+        primaryDataSourceName:
+          - calcite_jdbc_1

Review comment:
       If there is replication relationship between `calcite_jdbc_1` and 
`calcite_jdbc_2`, maybe `calcite_data_2.sql` is still needed.




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