Package org.apache.hadoop.hive.ql.plan

Examples of org.apache.hadoop.hive.ql.plan.MoveWork


                                        (ts.partSpec != null) ? ts.partSpec :
                                        new HashMap<String, String> (),
                                        isOverWrite);

    if(rTask != null) {
      rTask.addDependentTask(TaskFactory.get(new moveWork(getInputs(), getOutputs(), loadTableWork, null, true), this.conf));
    } else {
      rTask = TaskFactory.get(new moveWork(getInputs(), getOutputs(), loadTableWork, null, true), this.conf);
    }

    rootTasks.add(rTask);
  }
View Full Code Here


    cplan.getPathToAliases().put(fsConf.getDirName(), aliases);
    cplan.getAliasToWork().put(fsConf.getDirName(), ts_op);   
    cplan.getPathToPartitionInfo().put(fsConf.getDirName(), new partitionDesc(fsConf.getTableInfo(), null));
    cplan.setNumReduceTasks(-1);
   
    moveWork dummyMv = new moveWork(null, null, null, new loadFileDesc(fsOp.getConf().getDirName(), finalName, true, null, null), false);
    Task<? extends Serializable> dummyMergeTask = TaskFactory.get(dummyMv, ctx.getConf());
    List<Serializable> listWorks = new ArrayList<Serializable>();
    listWorks.add(dummyMv);
    listWorks.add(mergeTask.getWork());
    ConditionalWork cndWork = new ConditionalWork(listWorks);
View Full Code Here

  }
  private Task<? extends Serializable> findMoveTask(List<Task<? extends Serializable>> mvTasks, FileSinkOperator fsOp) {
    // find the move task
    for (Task<? extends Serializable> mvTsk : mvTasks) {
      moveWork mvWork = (moveWork)mvTsk.getWork();
      String srcDir = null;
      if (mvWork.getLoadFileWork() != null)
        srcDir = mvWork.getLoadFileWork().getSourceDir();
      else if (mvWork.getLoadTableWork() != null)
        srcDir = mvWork.getLoadTableWork().getSourceDir();
     
      if ((srcDir != null) && (srcDir.equalsIgnoreCase(fsOp.getConf().getDirName())))
        return mvTsk;
    }
    
View Full Code Here

    } else {
      // First we generate the move work as this needs to be made dependent on all
      // the tasks that have a file sink operation
      List<moveWork>  mv = new ArrayList<moveWork>();
      for (loadTableDesc ltd : loadTableWork)
        mvTask.add(TaskFactory.get(new moveWork(null, null, ltd, null, false), this.conf));

      boolean oneLoadFile = true;
      for (loadFileDesc lfd : loadFileWork) {
        if ( qb.isCTAS() ) {
          assert(oneLoadFile); // should not have more than 1 load file for CTAS
          // make the movetask's destination directory the table's destination.
          String location = qb.getTableDesc().getLocation();
          if ( location == null ) {
            // get the table's default location
            location = conf.getVar(HiveConf.ConfVars.METASTOREWAREHOUSE);
            assert(location.length() > 0 );
            if ( location.charAt(location.length()-1) != '/' ) {
              location += '/';
            }
            location += qb.getTableDesc().getTableName().toLowerCase();
          }
          lfd.setTargetDir(location);
          oneLoadFile = false;
        }
        mvTask.add(TaskFactory.get(new moveWork(null, null, null, lfd, false), this.conf));
      }
    }

    // generate map reduce plans
    GenMRProcContext procCtx =
View Full Code Here

    else {
      // First we generate the move work as this needs to be made dependent on all
      // the tasks that have a file sink operation
      List<moveWork>  mv = new ArrayList<moveWork>();
      for (loadTableDesc ltd : loadTableWork)
        mvTask.add(TaskFactory.get(new moveWork(ltd, null, false), this.conf));
      for (loadFileDesc lfd : loadFileWork)
        mvTask.add(TaskFactory.get(new moveWork(null, lfd, false), this.conf));
    }

    // generate map reduce plans
    GenMRProcContext procCtx =
      new GenMRProcContext(
View Full Code Here

    cplan.getPathToAliases().put(fsConf.getDirName(), aliases);
    cplan.getAliasToWork().put(fsConf.getDirName(), ts_op);   
    cplan.getPathToPartitionInfo().put(fsConf.getDirName(), new partitionDesc(fsConf.getTableInfo(), null));
    cplan.setNumReduceTasks(-1);
   
    moveWork dummyMv = new moveWork(null, new loadFileDesc(fsOp.getConf().getDirName(), finalName, true, null, null), false);
    Task<? extends Serializable> dummyMergeTask = TaskFactory.get(dummyMv, ctx.getConf());
    List<Serializable> listWorks = new ArrayList<Serializable>();
    listWorks.add(dummyMv);
    listWorks.add(mergeTask.getWork());
    ConditionalWork cndWork = new ConditionalWork(listWorks);
View Full Code Here

  }
  private Task<? extends Serializable> findMoveTask(List<Task<? extends Serializable>> mvTasks, FileSinkOperator fsOp) {
    // find the move task
    for (Task<? extends Serializable> mvTsk : mvTasks) {
      moveWork mvWork = (moveWork)mvTsk.getWork();
      String srcDir = null;
      if (mvWork.getLoadFileWork() != null)
        srcDir = mvWork.getLoadFileWork().getSourceDir();
      else if (mvWork.getLoadTableWork() != null)
        srcDir = mvWork.getLoadTableWork().getSourceDir();
     
      if ((srcDir != null) && (srcDir.equalsIgnoreCase(fsOp.getConf().getDirName())))
        return mvTsk;
    }
    
View Full Code Here

                                        (ts.partSpec != null) ? ts.partSpec :
                                        new HashMap<String, String> (),
                                        isOverWrite);

    if(rTask != null) {
      rTask.addDependentTask(TaskFactory.get(new moveWork(loadTableWork, null, true), this.conf));
    } else {
      rTask = TaskFactory.get(new moveWork(loadTableWork, null, true), this.conf);
    }

    rootTasks.add(rTask);
  }
View Full Code Here

    loadTableWork.add(new loadTableDesc(fromURI.toString(), Utilities.getTableDesc(ts.tableHandle),
                                        (ts.partSpec != null) ? ts.partSpec : new HashMap<String, String> (),
                                        isOverWrite));

    if(rTask != null) {
      rTask.addDependentTask(TaskFactory.get(new moveWork(loadTableWork, loadFileWork), this.conf));
    } else {
      rTask = TaskFactory.get(new moveWork(loadTableWork, loadFileWork), this.conf);
    }

    rootTasks.add(rTask);
  }
View Full Code Here

    else {
      // First we generate the move work as this needs to be made dependent on all
      // the tasks that have a file sink operation
      List<moveWork>  mv = new ArrayList<moveWork>();
      for (loadTableDesc ltd : loadTableWork)
        mvTask.add(TaskFactory.get(new moveWork(ltd, null, false), this.conf));
      for (loadFileDesc lfd : loadFileWork)
        mvTask.add(TaskFactory.get(new moveWork(null, lfd, false), this.conf));
    }

    // generate map reduce plans
    GenMRProcContext procCtx =
      new GenMRProcContext(
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.plan.MoveWork

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.