Package org.apache.tajo.engine.planner.enforce

Examples of org.apache.tajo.engine.planner.enforce.Enforcer


  /**
   *  Left semi join means that the left side is the FROM side table, and the right side is the IN side table.
   */
  private PhysicalExec createLeftAntiJoinPlan(TaskAttemptContext context, JoinNode plan,
                                              PhysicalExec leftExec, PhysicalExec rightExec) throws IOException {
    Enforcer enforcer = context.getEnforcer();
    EnforceProperty property = getAlgorithmEnforceProperty(enforcer, plan);
    if (property != null) {
      JoinAlgorithm algorithm = property.getJoin().getAlgorithm();
      switch (algorithm) {
        case IN_MEMORY_HASH_JOIN:
View Full Code Here


  /**
   *  Left semi join means that the left side is the FROM side table, and the right side is the IN side table.
   */
  private PhysicalExec createRightAntiJoinPlan(TaskAttemptContext context, JoinNode plan,
                                               PhysicalExec leftExec, PhysicalExec rightExec) throws IOException {
    Enforcer enforcer = context.getEnforcer();
    EnforceProperty property = getAlgorithmEnforceProperty(enforcer, plan);
    if (property != null) {
      JoinAlgorithm algorithm = property.getJoin().getAlgorithm();
      switch (algorithm) {
        case IN_MEMORY_HASH_JOIN:
View Full Code Here

  }

  private PhysicalExec createColumnPartitionStorePlan(TaskAttemptContext context,
                                                      StoreTableNode storeTableNode,
                                                      PhysicalExec child) throws IOException {
    Enforcer enforcer = context.getEnforcer();
    EnforceProperty property = getAlgorithmEnforceProperty(enforcer, storeTableNode);
    if (property != null) {
      ColumnPartitionAlgorithm algorithm = property.getColumnPartition().getAlgorithm();
      switch (algorithm) {
      case HASH_PARTITION:
View Full Code Here

    LOG.info("The planner chooses [Sort-based Column Partitioned Store] algorithm");
    return new SortBasedColPartitionStoreExec(context, storeTableNode, sortExec);
  }

  private boolean checkIfSortEquivalance(TaskAttemptContext ctx, ScanNode scanNode, Stack<LogicalNode> node) {
    Enforcer enforcer = ctx.getEnforcer();
    List<EnforceProperty> property = enforcer.getEnforceProperties(EnforceType.SORTED_INPUT);
    if (property != null && property.size() > 0 && node.peek().getType() == NodeType.SORT) {
      SortNode sortNode = (SortNode) node.peek();
      TajoWorkerProtocol.SortedInputEnforce sortEnforcer = property.get(0).getSortedInput();

      boolean condition = scanNode.getTableName().equals(sortEnforcer.getTableName());
View Full Code Here

    // Since the default intermediate file format is raw file, it is not problem right now.
    if (checkIfSortEquivalance(ctx, scanNode, node)) {
      FragmentProto [] fragments = ctx.getTables(scanNode.getCanonicalName());
      return new ExternalSortExec(ctx, sm, (SortNode) node.peek(), fragments);
    } else {
      Enforcer enforcer = ctx.getEnforcer();

      // check if this table is broadcasted one or not.
      boolean broadcastFlag = false;
      if (enforcer != null && enforcer.hasEnforceProperty(EnforceType.BROADCAST)) {
        List<EnforceProperty> properties = enforcer.getEnforceProperties(EnforceType.BROADCAST);
        for (EnforceProperty property : properties) {
          broadcastFlag |= scanNode.getCanonicalName().equals(property.getBroadcast().getTableName());
        }
      }
View Full Code Here

  }

  public PhysicalExec createGroupByPlan(TaskAttemptContext context,GroupbyNode groupbyNode, PhysicalExec subOp)
      throws IOException {

    Enforcer enforcer = context.getEnforcer();
    EnforceProperty property = getAlgorithmEnforceProperty(enforcer, groupbyNode);
    if (property != null) {
      GroupbyAlgorithm algorithm = property.getGroupby().getAlgorithm();
      if (algorithm == GroupbyAlgorithm.HASH_AGGREGATION) {
        return createInMemoryHashAggregation(context, groupbyNode, subOp);
View Full Code Here

      if (TUtil.checkEquals(sortNode.getSortKeys(), childSortExec.getSortSpecs())) {
        return child;
      }
    }

    Enforcer enforcer = context.getEnforcer();
    EnforceProperty property = getAlgorithmEnforceProperty(enforcer, sortNode);
    if (property != null) {
      SortEnforce.SortAlgorithm algorithm = property.getSort().getAlgorithm();
      if (algorithm == SortEnforce.SortAlgorithm.IN_MEMORY_SORT) {
        return new MemSortExec(context, sortNode, child);
View Full Code Here

    FileFragment[] frags = StorageManager.splitNG(conf, "default.employee", employee.getMeta(), employee.getPath(),
        Integer.MAX_VALUE);
    Path workDir = new Path(testDir, TestExternalSortExec.class.getName());
    TaskAttemptContext ctx = new TaskAttemptContext(conf,
        LocalTajoTestingUtility.newQueryUnitAttemptId(), new FileFragment[] { frags[0] }, workDir);
    ctx.setEnforcer(new Enforcer());
    Expr expr = analyzer.parse(QUERIES[0]);
    LogicalPlan plan = planner.createPlan(LocalTajoTestingUtility.createDummySession(), expr);
    LogicalNode rootNode = plan.getRootBlock().getRoot();

    PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf, sm);
View Full Code Here

    Expr expr = analyzer.parse(QUERIES[0]);
    LogicalPlan plan = planner.createPlan(LocalTajoTestingUtility.createDummySession(), expr);
    LogicalNode root = plan.getRootBlock().getRoot();

    JoinNode joinNode = PlannerUtil.findTopNode(root, NodeType.JOIN);
    Enforcer enforcer = new Enforcer();
    enforcer.enforceJoinAlgorithm(joinNode.getPID(), JoinAlgorithm.MERGE_JOIN);

    FileFragment[] empFrags = sm.splitNG(conf, "default.e", employee.getMeta(), employee.getPath(), Integer.MAX_VALUE);
    FileFragment[] peopleFrags = sm.splitNG(conf, "default.p", people.getMeta(), people.getPath(), Integer.MAX_VALUE);
    FileFragment[] merged = TUtil.concat(empFrags, peopleFrags);
View Full Code Here

    FileFragment[] frags = StorageManager.splitNG(conf, "default.employee", employeeMeta, tableDir, Integer.MAX_VALUE);

    TaskAttemptContext ctx = new TaskAttemptContext(conf, LocalTajoTestingUtility.newQueryUnitAttemptId(),
        new FileFragment[] {frags[0]}, testDir);
    ctx.setEnforcer(new Enforcer());
    Expr expr = analyzer.parse(SORT_QUERY[0]);
    LogicalPlan plan = planner.createPlan(LocalTajoTestingUtility.createDummySession(), expr);
    LogicalNode rootNode = optimizer.optimize(plan);

    PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf,sm);
View Full Code Here

TOP

Related Classes of org.apache.tajo.engine.planner.enforce.Enforcer

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.