guimingyue commented on a change in pull request #10889:
URL: https://github.com/apache/shardingsphere/pull/10889#discussion_r656391039



##########
File path: 
shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/GroupBySqlNodeConverter.java
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.infra.optimize.core.convert.converter.impl;
+
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import 
org.apache.shardingsphere.infra.optimize.core.convert.converter.SqlNodeConverter;
+import 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
+import 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.OrderByItemSegment;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * Group by converter.
+ */
+public final class GroupBySqlNodeConverter extends 
AbstractOrderBySqlNodeConverter implements SqlNodeConverter<GroupBySegment, 
SqlNodeList> {
+    @Override

Review comment:
       done

##########
File path: 
shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/JoinTableSqlNodeConverter.java
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.infra.optimize.core.convert.converter.impl;
+
+import org.apache.calcite.sql.JoinConditionType;
+import org.apache.calcite.sql.JoinType;
+import org.apache.calcite.sql.SqlJoin;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import 
org.apache.shardingsphere.infra.optimize.core.convert.converter.SqlNodeConverter;
+import 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
+import 
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.JoinTableSegment;
+
+import java.util.Optional;
+
+/**
+ * Join converter.
+ */
+public final class JoinTableSqlNodeConverter implements 
SqlNodeConverter<JoinTableSegment, SqlNode> {
+
+    private static final String JOIN_TYPE_INNER = "INNER";
+
+    private static final String JOIN_TYPE_LEFT = "LEFT";
+
+    private static final String JOIN_TYPE_RIGHT = "RIGHT";
+
+    private static final String JOIN_TYPE_FULL = "FULL";
+    
+    @Override
+    public Optional<SqlNode> convert(JoinTableSegment join) {
+        String joinType = join.getJoinType();
+        SqlNode left = new 
TableSqlNodeConverter().convert(join.getLeft()).get();
+        SqlNode right = new 
TableSqlNodeConverter().convert(join.getRight()).get();
+        ExpressionSegment expressionSegment = join.getCondition();
+        Optional<SqlNode> condition = new 
ExpressionSqlNodeConverter().convert(expressionSegment);
+

Review comment:
       done




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