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 2022/10/27 14:11:30 UTC

[GitHub] [shardingsphere] gxxiong opened a new pull request, #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

gxxiong opened a new pull request, #21808:
URL: https://github.com/apache/shardingsphere/pull/21808

   Ref #20435 .
   
   Changes proposed in this pull request:
   -Support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [X] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [X] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [X] I have passed maven check locally : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [X] I have added corresponding unit tests for my changes.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #21808:
URL: https://github.com/apache/shardingsphere/pull/21808#discussion_r1008681825


##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java:
##########
@@ -123,28 +123,47 @@ public void assertFindPlainColumn() {
         assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findPlainColumn("t_encrypt", "notExistLogicColumn").isPresent());
     }
     
+    @Test
+    public void assertFindFuzzyQueryColumn() {
+        assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findFuzzyQueryColumn("t_encrypt", "pwd_cipher").isPresent());
+    }
+    
+    @Test
+    public void assertGetEncryptFuzzyQueryValues() {
+        List<Object> encryptFuzzyQueryValues = new EncryptRule(createEncryptRuleConfiguration())
+                .getEncryptFuzzyQueryValues(DefaultDatabase.LOGIC_NAME, DefaultDatabase.LOGIC_NAME, "t_encrypt", "pwd", Collections.singletonList(null));
+        for (final Object value : encryptFuzzyQueryValues) {

Review Comment:
   Please remove final and rename value to each.



##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java:
##########
@@ -123,28 +123,47 @@ public void assertFindPlainColumn() {
         assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findPlainColumn("t_encrypt", "notExistLogicColumn").isPresent());
     }
     
+    @Test
+    public void assertFindFuzzyQueryColumn() {
+        assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findFuzzyQueryColumn("t_encrypt", "pwd_cipher").isPresent());
+    }
+    
+    @Test
+    public void assertGetEncryptFuzzyQueryValues() {
+        List<Object> encryptFuzzyQueryValues = new EncryptRule(createEncryptRuleConfiguration())
+                .getEncryptFuzzyQueryValues(DefaultDatabase.LOGIC_NAME, DefaultDatabase.LOGIC_NAME, "t_encrypt", "pwd", Collections.singletonList(null));
+        for (final Object value : encryptFuzzyQueryValues) {
+            assertNull(value);
+        }
+    }
+    
+    @Test
+    public void assertGetFuzzyQueryColumns() {
+        assertFalse(new EncryptRule(createEncryptRuleConfiguration()).getFuzzyQueryColumns("t_encrypt").isEmpty());
+    }
+    
     @Test
     public void assertIsQueryWithCipherColumn() {
-        EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor", null);
+        EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "", "test_encryptor", null);
         EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), null);
         AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration(
                 Collections.singleton(tableConfig), Collections.singletonMap("test_encryptor", new CoreEncryptAlgorithmFixture()), true);
         EncryptRule actual = new EncryptRule(ruleConfig);
         assertTrue(actual.isQueryWithCipherColumn("t_encrypt", "encrypt_column"));
         

Review Comment:
   Please remove useless blank line here.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] gxxiong commented on a diff in pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
gxxiong commented on code in PR #21808:
URL: https://github.com/apache/shardingsphere/pull/21808#discussion_r1009208149


##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java:
##########
@@ -123,28 +123,47 @@ public void assertFindPlainColumn() {
         assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findPlainColumn("t_encrypt", "notExistLogicColumn").isPresent());
     }
     
+    @Test
+    public void assertFindFuzzyQueryColumn() {
+        assertFalse(new EncryptRule(createEncryptRuleConfiguration()).findFuzzyQueryColumn("t_encrypt", "pwd_cipher").isPresent());
+    }
+    
+    @Test
+    public void assertGetEncryptFuzzyQueryValues() {
+        List<Object> encryptFuzzyQueryValues = new EncryptRule(createEncryptRuleConfiguration())
+                .getEncryptFuzzyQueryValues(DefaultDatabase.LOGIC_NAME, DefaultDatabase.LOGIC_NAME, "t_encrypt", "pwd", Collections.singletonList(null));
+        for (final Object value : encryptFuzzyQueryValues) {
+            assertNull(value);
+        }
+    }
+    
+    @Test
+    public void assertGetFuzzyQueryColumns() {
+        assertFalse(new EncryptRule(createEncryptRuleConfiguration()).getFuzzyQueryColumns("t_encrypt").isEmpty());
+    }
+    
     @Test
     public void assertIsQueryWithCipherColumn() {
-        EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor", null);
+        EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "", "test_encryptor", null);
         EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), null);
         AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration(
                 Collections.singleton(tableConfig), Collections.singletonMap("test_encryptor", new CoreEncryptAlgorithmFixture()), true);
         EncryptRule actual = new EncryptRule(ruleConfig);
         assertTrue(actual.isQueryWithCipherColumn("t_encrypt", "encrypt_column"));
         

Review Comment:
   Problem is fixed



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang commented on pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #21808:
URL: https://github.com/apache/shardingsphere/pull/21808#issuecomment-1297902868

   > 
   
   
   
   > LGTM, @RaigorJiang Can you help double check?
   
   Good implementation, merged!
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] RaigorJiang merged pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #21808:
URL: https://github.com/apache/shardingsphere/pull/21808


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] gxxiong closed pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
gxxiong closed pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT
URL: https://github.com/apache/shardingsphere/pull/21808


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #21808: support the fuzzyQueryColumn and fuzzyQueryEncryptorName for distsql and UT, SIT

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #21808:
URL: https://github.com/apache/shardingsphere/pull/21808#issuecomment-1295832476

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/21808?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#21808](https://codecov.io/gh/apache/shardingsphere/pull/21808?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8fac3e3) into [master](https://codecov.io/gh/apache/shardingsphere/commit/e3f6fbb0b57d6b788b93b1196cdab355d13da085?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e3f6fbb) will **increase** coverage by `0.16%`.
   > The diff coverage is `33.33%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #21808      +/-   ##
   ============================================
   + Coverage     60.79%   60.95%   +0.16%     
   + Complexity     2446     2445       -1     
   ============================================
     Files          4118     4107      -11     
     Lines         57478    57279     -199     
     Branches       9693     9685       -8     
   ============================================
   - Hits          34945    34916      -29     
   + Misses        19627    19451     -176     
   - Partials       2906     2912       +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/21808?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...pi/config/rule/EncryptColumnRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvZW5jcnlwdC9hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvYXBpL2NvbmZpZy9ydWxlL0VuY3J5cHRDb2x1bW5SdWxlQ29uZmlndXJhdGlvbi5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...t/distsql/parser/segment/EncryptColumnSegment.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvZW5jcnlwdC9kaXN0c3FsL3N0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9zZWdtZW50L0VuY3J5cHRDb2x1bW5TZWdtZW50LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `64.10% <16.66%> (-6.49%)` | :arrow_down: |
   | [...ndler/converter/EncryptRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvZW5jcnlwdC9kaXN0c3FsL2hhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL2NvbnZlcnRlci9FbmNyeXB0UnVsZVN0YXRlbWVudENvbnZlcnRlci5qYXZh) | `84.37% <66.66%> (-4.52%)` | :arrow_down: |
   | [.../queryable/ExportDatabaseConfigurationHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL3F1ZXJ5YWJsZS9FeHBvcnREYXRhYmFzZUNvbmZpZ3VyYXRpb25IYW5kbGVyLmphdmE=) | `57.35% <0.00%> (-15.73%)` | :arrow_down: |
   | [...engauss/ingest/wal/decode/MppdbDecodingPlugin.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9vcGVuZ2F1c3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RhdGEvcGlwZWxpbmUvb3BlbmdhdXNzL2luZ2VzdC93YWwvZGVjb2RlL01wcGRiRGVjb2RpbmdQbHVnaW4uamF2YQ==) | `74.10% <0.00%> (-0.66%)` | :arrow_down: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3FsLXBhcnNlci9kaWFsZWN0L29yYWNsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9vcmFjbGUvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9PcmFjbGVTdGF0ZW1lbnRTUUxWaXNpdG9yLmphdmE=) | `72.45% <0.00%> (-0.42%)` | :arrow_down: |
   | [...sphere/agent/api/point/PluginInterceptorPoint.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9hZ2VudC9hcGkvcG9pbnQvUGx1Z2luSW50ZXJjZXB0b3JQb2ludC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...phere/agent/api/result/MethodInvocationResult.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YWdlbnQvYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9hZ2VudC9hcGkvcmVzdWx0L01ldGhvZEludm9jYXRpb25SZXN1bHQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...eline/mysql/ingest/GlobalTableMapEventMapping.java](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9teXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9teXNxbC9pbmdlc3QvR2xvYmFsVGFibGVNYXBFdmVudE1hcHBpbmcuamF2YQ==) | `66.66% <0.00%> (ø)` | |
   | ... and [54 more](https://codecov.io/gh/apache/shardingsphere/pull/21808/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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