protected SQLSelectGroupByClause createGroupBy() { return new SQLSelectGroupByClause(); }
public SQLSelectGroupByClause clone() { SQLSelectGroupByClause x = new SQLSelectGroupByClause(); for (SQLExpr item : items) { SQLExpr item2 = item.clone(); item2.setParent(x); x.items.add(item2); } if (having != null) { x.setHaving(having.clone()); } x.withRollUp = withRollUp; x.withCube = withCube; return x; } }
protected SQLSelectGroupByClause createGroupBy() { return new SQLSelectGroupByClause(); }
groupBy = new SQLSelectGroupByClause(); groupBy = new SQLSelectGroupByClause();
accept(Token.BY); SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause(); if (lexer.identifierEquals(FnvHash.Constants.ROLLUP)) { lexer.nextToken(); lexer.nextToken(); SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause(); groupBy.setHaving(this.exprParser.expr());
public SQLSelectGroupByClause clone() { SQLSelectGroupByClause x = new SQLSelectGroupByClause(); for (SQLExpr item : items) { SQLExpr item2 = item.clone(); item2.setParent(x); x.items.add(item2); } if (having != null) { x.setHaving(having.clone()); } x.withRollUp = withRollUp; x.withCube = withCube; return x; } }
accept(Token.BY); SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause(); if (lexer.identifierEquals(FnvHash.Constants.ROLLUP)) { lexer.nextToken(); lexer.nextToken(); SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause(); groupBy.setHaving(this.exprParser.expr());
private void parseAggGroupCommon(SchemaConfig schema, SQLStatement stmt, RouteResultset rrs, MySqlSelectQueryBlock mysqlSelectQuery, TableConfig tc) throws SQLException { Map<String, String> aliaColumns = new HashMap<>(); boolean isDistinct = (mysqlSelectQuery.getDistionOption() == SQLSetQuantifier.DISTINCT) || (mysqlSelectQuery.getDistionOption() == SQLSetQuantifier.DISTINCTROW); parseAggExprCommon(schema, rrs, mysqlSelectQuery, aliaColumns, tc, isDistinct); if (rrs.isNeedOptimizer()) { tryAddLimit(schema, tc, mysqlSelectQuery); rrs.setSqlStatement(stmt); return; } // distinct change to group by if (isDistinct) { mysqlSelectQuery.setDistionOption(0); SQLSelectGroupByClause groupBy = new SQLSelectGroupByClause(); for (String fieldName : aliaColumns.keySet()) { groupBy.addItem(new SQLIdentifierExpr(fieldName)); } mysqlSelectQuery.setGroupBy(groupBy); } // setGroupByCols if (mysqlSelectQuery.getGroupBy() != null) { List<SQLExpr> groupByItems = mysqlSelectQuery.getGroupBy().getItems(); String[] groupByCols = buildGroupByCols(groupByItems, aliaColumns); rrs.setGroupByCols(groupByCols); } if (isDistinct) { rrs.changeNodeSqlAfterAddLimit(statementToString(stmt), 0, -1); } }
groupBy = new SQLSelectGroupByClause(); groupBy = new SQLSelectGroupByClause();