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/11/22 05:45:35 UTC

[GitHub] [shardingsphere] Qianyi951015 opened a new pull request, #22332: Update Oracle SQL XMLSERIALIZE function parse

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

   Fixes #22331.
   
   Ref: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/XMLSERIALIZE.html#GUID-F2D5ECE7-3838-4DD5-BE8F-2AEE7890AA1C
   
   <img width="716" alt="image" src="https://user-images.githubusercontent.com/57847965/203234379-1ab5709f-0179-42ca-b3a3-8ee4a4a248f0.png">
   
   
   ---
   
   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 merged pull request #22332: Update Oracle SQL XMLSERIALIZE function parse

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


-- 
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] Qianyi951015 commented on pull request #22332: Update Oracle SQL XMLSERIALIZE function parse

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

   @strongduanmu Hi, i've corrected all the mistakes you mentioned.


-- 
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 #22332: Update Oracle SQL XMLSERIALIZE function parse

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


##########
sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlSerializeFunctionSegment.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.sql.parser.sql.common.segment.dml.expr;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
+
+/**
+ * Xml Serialize Function segment.
+ */
+@RequiredArgsConstructor
+@Getter
+@ToString
+public final class XmlSerializeFunctionSegment implements ComplexExpressionSegment, ProjectionSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    
+    private final String functionName;
+    
+    private final ExpressionSegment parameter;
+    
+    private final String datatype;

Review Comment:
   Please rename datatype to dataType.



##########
sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java:
##########
@@ -640,6 +645,16 @@ public ASTNode visitXmlRootFunction(final XmlRootFunctionContext ctx) {
         return result;
     }
     
+    @Override
+    public ASTNode visitXmlSerializeFunction(final XmlSerializeFunctionContext ctx) {
+        final String dataType = null == ctx.dataType() ? null : ctx.dataType().getText();

Review Comment:
   Please remove final in method domain.



##########
sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlSerializeFunctionSegment.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.sql.parser.sql.common.segment.dml.expr;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
+
+/**
+ * Xml Serialize Function segment.

Review Comment:
   `Xml serialize function segment.` may be better.



-- 
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 #22332: Update Oracle SQL XMLSERIALIZE function parse

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/22332?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 [#22332](https://codecov.io/gh/apache/shardingsphere/pull/22332?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1385c20) into [master](https://codecov.io/gh/apache/shardingsphere/commit/b14983bc0eb523b25a7860aae190ccecdbfbd4d7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b14983b) will **decrease** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #22332      +/-   ##
   ============================================
   - Coverage     51.02%   51.00%   -0.02%     
     Complexity     2507     2507              
   ============================================
     Files          4164     4164              
     Lines         57814    57823       +9     
     Branches       9813     9815       +2     
   ============================================
   - Hits          29497    29494       -3     
   - Misses        25774    25786      +12     
     Partials       2543     2543              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/22332?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/22332/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-c3FsLXBhcnNlci9kaWFsZWN0L29yYWNsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9vcmFjbGUvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9PcmFjbGVETUxTdGF0ZW1lbnRTUUxWaXNpdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/22332/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=) | `0.00% <0.00%> (ø)` | |
   | [...handler/distsql/ral/hint/enums/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/22332/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-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL2hpbnQvZW51bXMvSGludFNvdXJjZVR5cGUuamF2YQ==) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
   
   :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


[GitHub] [shardingsphere] strongduanmu commented on pull request #22332: Update Oracle SQL XMLSERIALIZE function parse

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

   > @strongduanmu Hi, i've corrected all the mistakes you mentioned.
   
   Good job, 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