use of com.alibaba.druid.sql.ast.statement.SQLSelectOrderByItem in project Mycat-Server by MyCATApache.
the class DruidSelectOracleParser method parseOrderAggGroupOracle.
protected void parseOrderAggGroupOracle(SQLStatement stmt, RouteResultset rrs, OracleSelectQueryBlock mysqlSelectQuery, SchemaConfig schema) {
Map<String, String> aliaColumns = parseAggGroupCommon(schema, stmt, rrs, mysqlSelectQuery);
OracleSelect oracleSelect = (OracleSelect) mysqlSelectQuery.getParent();
if (oracleSelect.getOrderBy() != null) {
List<SQLSelectOrderByItem> orderByItems = oracleSelect.getOrderBy().getItems();
rrs.setOrderByCols(buildOrderByCols(orderByItems, aliaColumns));
}
isNeedParseOrderAgg = false;
}
use of com.alibaba.druid.sql.ast.statement.SQLSelectOrderByItem in project Mycat-Server by MyCATApache.
the class DruidSelectParser method parseOrderAggGroupMysql.
protected void parseOrderAggGroupMysql(SchemaConfig schema, SQLStatement stmt, RouteResultset rrs, MySqlSelectQueryBlock mysqlSelectQuery) {
MySqlSchemaStatVisitor visitor = new MySqlSchemaStatVisitor();
stmt.accept(visitor);
// rrs.setGroupByCols((String[])visitor.getGroupByColumns().toArray());
if (!isNeedParseOrderAgg) {
return;
}
Map<String, String> aliaColumns = parseAggGroupCommon(schema, stmt, rrs, mysqlSelectQuery);
//setOrderByCols
if (mysqlSelectQuery.getOrderBy() != null) {
List<SQLSelectOrderByItem> orderByItems = mysqlSelectQuery.getOrderBy().getItems();
rrs.setOrderByCols(buildOrderByCols(orderByItems, aliaColumns));
}
isNeedParseOrderAgg = false;
}
Aggregations