guimingyue commented on pull request #9934: URL: https://github.com/apache/shardingsphere/pull/9934#issuecomment-864961831
> @guimingyue Cool, I will give it a look. > Could you look at the latest master branch? I suppose 1 and 2 are supported now, and in terms of 3, could you give more clarification? > > ``` > 1. join type is missing. > 2. having clause of group by is not supported. > 3. expression has not been pared. > ``` I have tested in the latest branch, the result follows. - joinType of JoinTableSegment is still null for inner join and left outer join according testcase of `org.apache.shardingsphere.infra.optimize.core.convert.SqlNodeConverterTest` in my PR. - having clause is supported now, but the inner expression of AggregationProjectionSegment is String, take this sql text as an example, `select order_id, user_id from t_order where order_id = 10 group by order_id having sum(order_id) > 0`, the type of expr field of `HavingSegment` is `BinaryOperationExpression` and the left parameter type of `BinaryOperationExpression` object is `AggregationProjectionSegment`. As a result, the type of `innerExpression` field is String whose value is `(order_id)`, which should be parsed as `ColumnSegment` object. - the field text of `ExpressionProjectionSegment` is a Stirng type, which cannot be converted to a AST expression, for example, in the select list of this sql text `select 10 + 30, order_id + 10, order_id, user_id from t_order`, the expression of `10+30` will be parsed as an `ExpressionProjectionSegment` object. -- 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]
