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/12/24 15:46:50 UTC

[GitHub] [shardingsphere] gxxiong opened a new pull request, #23088: Implement ResultDecoratorEngine for MaskRule and add mask processing logic

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

   Ref #22759 .
   
   Changes proposed in this pull request:
     -Implement ResultDecoratorEngine for MaskRule and add mask processing logic
   
   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 : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -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 #23088: Implement ResultDecoratorEngine for MaskRule and add mask processing logic

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


##########
features/mask/core/src/main/java/org/apache/shardingsphere/mask/merge/dql/MaskAlgorithmMetaData.java:
##########
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mask.merge.dql;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.infra.binder.segment.select.projection.Projection;
+import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ColumnProjection;
+import org.apache.shardingsphere.infra.binder.segment.table.TablesContext;
+import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
+import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.mask.context.MaskContextBuilder;
+import org.apache.shardingsphere.mask.rule.MaskRule;
+import org.apache.shardingsphere.mask.spi.MaskAlgorithm;
+import org.apache.shardingsphere.mask.spi.context.MaskContext;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Mask algorithm meta data.
+ */
+@SuppressWarnings("rawtypes")
+@RequiredArgsConstructor
+public final class MaskAlgorithmMetaData {
+    
+    private final ShardingSphereDatabase database;
+    
+    private final MaskRule maskRule;
+    
+    private final SelectStatementContext selectStatementContext;
+    
+    /**
+     * Find MaskAlgorithm.

Review Comment:
   `Find mask algorithm.` may be better.



##########
features/mask/core/src/main/java/org/apache/shardingsphere/mask/rule/MaskRule.java:
##########
@@ -48,6 +49,18 @@ public MaskRule(final MaskRuleConfiguration ruleConfig) {
         ruleConfig.getTables().forEach(each -> tables.put(each.getName().toLowerCase(), new MaskTable(each)));
     }
     
+    /**
+     * Find maskAlgorithm.

Review Comment:
   `Find mask algorithm.` may be better.



##########
features/mask/api/src/main/java/org/apache/shardingsphere/mask/spi/context/MaskContext.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mask.spi.context;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * Mask context.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class MaskContext {

Review Comment:
   Why we need MaskContext?



-- 
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 merged pull request #23088: Implement ResultDecoratorEngine for MaskRule and add mask processing logic

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


-- 
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 #23088: Implement ResultDecoratorEngine for MaskRule and add mask processing logic

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/23088?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 [#23088](https://codecov.io/gh/apache/shardingsphere/pull/23088?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ac888c4) into [master](https://codecov.io/gh/apache/shardingsphere/commit/0967b62e0ca3408f1e666020b830641e912440ae?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0967b62) will **increase** coverage by `0.04%`.
   > The diff coverage is `65.27%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #23088      +/-   ##
   ============================================
   + Coverage     49.96%   50.00%   +0.04%     
   - Complexity     2426     2427       +1     
   ============================================
     Files          4112     4118       +6     
     Lines         57403    57457      +54     
     Branches       9065     9077      +12     
   ============================================
   + Hits          28680    28730      +50     
     Misses        26213    26213              
   - Partials       2510     2514       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/23088?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...arser/engine/api/DistSQLStatementParserEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-ZGlzdHNxbC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2Rpc3RzcWwvcGFyc2VyL2VuZ2luZS9hcGkvRGlzdFNRTFN0YXRlbWVudFBhcnNlckVuZ2luZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...dbdiscovery/algorithm/DatabaseDiscoveryEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-ZmVhdHVyZXMvZGItZGlzY292ZXJ5L2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiZGlzY292ZXJ5L2FsZ29yaXRobS9EYXRhYmFzZURpc2NvdmVyeUVuZ2luZS5qYXZh) | `36.11% <0.00%> (ø)` | |
   | [...algorithm/like/CharDigestLikeEncryptAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-ZmVhdHVyZXMvZW5jcnlwdC9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbmNyeXB0L2FsZ29yaXRobS9saWtlL0NoYXJEaWdlc3RMaWtlRW5jcnlwdEFsZ29yaXRobS5qYXZh) | `71.92% <0.00%> (ø)` | |
   | [.../org/apache/shardingsphere/mask/rule/MaskRule.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-ZmVhdHVyZXMvbWFzay9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tYXNrL3J1bGUvTWFza1J1bGUuamF2YQ==) | `63.63% <0.00%> (+63.63%)` | :arrow_up: |
   | [...org/apache/shardingsphere/mask/rule/MaskTable.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-ZmVhdHVyZXMvbWFzay9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tYXNrL3J1bGUvTWFza1RhYmxlLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...uery/impl/driver/jdbc/type/util/ResultSetUtil.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-aW5mcmEvZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9leGVjdXRlL3Jlc3VsdC9xdWVyeS9pbXBsL2RyaXZlci9qZGJjL3R5cGUvdXRpbC9SZXN1bHRTZXRVdGlsLmphdmE=) | `74.50% <0.00%> (ø)` | |
   | [...driver/jdbc/core/driver/DriverDataSourceCache.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-amRiYy9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kcml2ZXIvamRiYy9jb3JlL2RyaXZlci9Ecml2ZXJEYXRhU291cmNlQ2FjaGUuamF2YQ==) | `60.00% <0.00%> (ø)` | |
   | [...e/execute/ShardingSphereDataScheduleCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-a2VybmVsL2RhdGEtcGlwZWxpbmUvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9jb3JlL2V4ZWN1dGUvU2hhcmRpbmdTcGhlcmVEYXRhU2NoZWR1bGVDb2xsZWN0b3IuamF2YQ==) | `68.75% <0.00%> (ø)` | |
   | [...esql/util/PostgreSQLPipelineFreemarkerManager.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL3Bvc3RncmVzcWwvdXRpbC9Qb3N0Z3JlU1FMUGlwZWxpbmVGcmVlbWFya2VyTWFuYWdlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...he/shardingsphere/mode/manager/ContextManager.java](https://codecov.io/gh/apache/shardingsphere/pull/23088/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-bW9kZS9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvQ29udGV4dE1hbmFnZXIuamF2YQ==) | `54.92% <0.00%> (ø)` | |
   | ... and [16 more](https://codecov.io/gh/apache/shardingsphere/pull/23088/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