Package org.apache.tajo.algebra.Aggregation

Examples of org.apache.tajo.algebra.Aggregation.GroupElement


          grouping_element().size()];
      for (int i = 0; i < groups.length; i++) {
        SQLParser.Grouping_elementContext element =
            ctx.grouping_element_list().grouping_element().get(i);
        if (element.ordinary_grouping_set() != null) {
          groups[i] = new GroupElement(GroupType.OrdinaryGroup,
              getColumnReferences(element.ordinary_grouping_set().column_reference_list()));
        } else if (element.rollup_list() != null) {
          groups[i] = new GroupElement(GroupType.Rollup,
              getColumnReferences(element.rollup_list().c.column_reference_list()));
        } else if (element.cube_list() != null) {
          groups[i] = new GroupElement(GroupType.Cube,
              getColumnReferences(element.cube_list().c.column_reference_list()));
        }
      }
      clause.setGroups(groups);
    }
View Full Code Here


            ordinaryExprs = new ArrayList<Expr>();
          }
          Collections.addAll(ordinaryExprs, getRowValuePredicandsFromOrdinaryGroupingSet(element.ordinary_grouping_set()));
        } else if (element.rollup_list() != null) {
          groupSize++;
          groups.add(new GroupElement(GroupType.Rollup,
              getRowValuePredicandsFromOrdinaryGroupingSetList(element.rollup_list().c)));
        } else if (element.cube_list() != null) {
          groupSize++;
          groups.add(new GroupElement(GroupType.Cube,
              getRowValuePredicandsFromOrdinaryGroupingSetList(element.cube_list().c)));
        }
      }

      if (ordinaryExprs != null) {
        groups.set(0, new GroupElement(GroupType.OrdinaryGroup, ordinaryExprs.toArray(new Expr[ordinaryExprs.size()])));
        clause.setGroups(groups.subList(0, groupSize).toArray(new GroupElement[groupSize]));
      } else if (groupSize > 1) {
        clause.setGroups(groups.subList(1, groupSize).toArray(new GroupElement[groupSize - 1]));
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.tajo.algebra.Aggregation.GroupElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.