You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "kanha-gupta (via GitHub)" <gi...@apache.org> on 2023/07/21 20:46:40 UTC

[GitHub] [shardingsphere] kanha-gupta opened a new pull request, #27361: support for CollateExpression

kanha-gupta opened a new pull request, #27361:
URL: https://github.com/apache/shardingsphere/pull/27361

   Ref #24200 
   
   Code demonstration PR
   work in SqlCollation naming logic pending
   
   ![Screenshot (386)](https://github.com/apache/shardingsphere/assets/92207457/9e7c148a-a74b-40da-927e-d77457176b72)
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] 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.
   - [ ] 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 #27361: support for CollateExpression

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on code in PR #27361:
URL: https://github.com/apache/shardingsphere/pull/27361#discussion_r1271450176


##########
parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/CollateExpression.java:
##########
@@ -33,6 +36,9 @@ public final class CollateExpression implements ExpressionSegment {
     private final int stopIndex;
     
     private final SimpleExpressionSegment collateName;
+
+    @Nullable
+    private final ColumnSegment tableName;

Review Comment:
   Besides, why use tableName for ColumnSegment?



##########
kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CollateExpressionConverter.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.sqlfederation.compiler.converter.segment.expression.impl;
+
+import org.apache.calcite.sql.SqlCollation;
+
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CollateExpression;
+import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter;
+
+import java.util.Optional;
+
+public final class CollateExpressionConverter implements SQLSegmentConverter<CollateExpression, SqlNode> {

Review Comment:
   Please add java doc for CollateExpressionConverter.



##########
parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/CollateExpression.java:
##########
@@ -33,6 +36,9 @@ public final class CollateExpression implements ExpressionSegment {
     private final int stopIndex;
     
     private final SimpleExpressionSegment collateName;
+
+    @Nullable

Review Comment:
   Please remove @Nullable annotation, you can use following code.
   
   ```java
   public Optional< ColumnSegment> getTableName() {
   ...
   }
   ```



-- 
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 #27361: support for CollateExpression

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu merged PR #27361:
URL: https://github.com/apache/shardingsphere/pull/27361


-- 
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] kanha-gupta commented on pull request #27361: support for CollateExpression

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta commented on PR #27361:
URL: https://github.com/apache/shardingsphere/pull/27361#issuecomment-1646222986

   @strongduanmu Sir please review, Collate naming logic requires work :)


-- 
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 #27361: support for CollateExpression

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #27361:
URL: https://github.com/apache/shardingsphere/pull/27361#issuecomment-1646842705

   > @strongduanmu Sir please review, Collate naming logic requires work :)
   
   Good job, I will review this pr.


-- 
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] kanha-gupta commented on pull request #27361: support for CollateExpression

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta commented on PR #27361:
URL: https://github.com/apache/shardingsphere/pull/27361#issuecomment-1674772425

   @strongduanmu Please review, Collate queries are being parsed now :) 


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