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

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


      }
    }

    while (iterPath.hasNext()) {
      Path nxt = iterPath.next();
      partitionDesc prt = iterPartDesc.next();
      FileSystem fs = nxt.getFileSystem(job);
      if (fs.exists(nxt)) {
        FileStatus[] fStats = fs.listStatus(nxt);
        for (FileStatus fStat : fStats) {
          if (fStat.getLen() > 0) {
View Full Code Here


    if (isEmptyPath) {
      pathToPartitionInfo.put(newPath.toUri().toString(), pathToPartitionInfo.get(path));
      pathToPartitionInfo.remove(path);
    }
    else {
      partitionDesc pDesc = work.getAliasToPartnInfo().get(alias).clone();
      pathToPartitionInfo.put(newPath.toUri().toString(), pDesc);
    }
    work.setPathToPartitionInfo(pathToPartitionInfo);

    String onefile = newPath.toString();
View Full Code Here

    cplan.setReducer(extract);
    ArrayList<String> aliases = new ArrayList<String>();
    aliases.add(fsConf.getDirName());
    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>();
View Full Code Here

      String taskTmpDir = mjCtx.getTaskTmpDir();
      tableDesc tt_desc = mjCtx.getTTDesc();
      assert plan.getPathToAliases().get(taskTmpDir) == null;
      plan.getPathToAliases().put(taskTmpDir, new ArrayList<String>());
      plan.getPathToAliases().get(taskTmpDir).add(taskTmpDir);
      plan.getPathToPartitionInfo().put(taskTmpDir, new partitionDesc(tt_desc, null));
      plan.getAliasToWork().put(taskTmpDir, mjCtx.getRootMapJoinOp());
      return dest;
    }
   
    return dest;
View Full Code Here

      pathToAliases.put("/testDir", aliases);

      // initialize pathToTableInfo
      // Default: treat the table as a single column "col"
      tableDesc td = Utilities.defaultTd;
      partitionDesc pd = new partitionDesc(td, null);
      LinkedHashMap<String,org.apache.hadoop.hive.ql.plan.partitionDesc> pathToPartitionInfo = new
        LinkedHashMap<String,org.apache.hadoop.hive.ql.plan.partitionDesc> ();
      pathToPartitionInfo.put("/testDir", pd);

      // initialize aliasToWork
View Full Code Here

          Utilities.getMapRedWork(job).getPathToPartitionInfo();

        // extract all the inputFormatClass names for each chunk in the CombinedSplit.
        Path[] ipaths = inputSplitShim.getPaths();
        for (int i = 0; i < ipaths.length; i++) {
          partitionDesc part = null;
          try {
            part = getPartitionDescFromPath(pathToPartitionInfo, ipaths[i].getParent());
          } catch (IOException e) {
            // The file path may be present in case of sampling - so ignore that
            part = null;
          }

          if (part == null) {
            try {
              part = getPartitionDescFromPath(pathToPartitionInfo, ipaths[i]);
            } catch (IOException e) {
              LOG.warn("CombineHiveInputSplit unable to find table description for " +
                       ipaths[i].getParent());
              continue;
            }
          }
         
          // create a new InputFormat instance if this is the first time to see this class
          if (i == 0)
            inputFormatClassName = part.getInputFileFormatClass().getName();
          else
            assert inputFormatClassName.equals(part.getInputFileFormatClass().getName());
        }
      }
    }
View Full Code Here

      if (inputFormatClassName == null) {
        Map<String, partitionDesc> pathToPartitionInfo =
          Utilities.getMapRedWork(getJob()).getPathToPartitionInfo();
       
        // extract all the inputFormatClass names for each chunk in the CombinedSplit.
        partitionDesc part = null;
        try {
          part = getPartitionDescFromPath(pathToPartitionInfo, inputSplitShim.getPath(0).getParent());
        } catch (IOException e) {
          // The file path may be present in case of sampling - so ignore that
          part = null;
        }

        if (part == null)
          part = getPartitionDescFromPath(pathToPartitionInfo, inputSplitShim.getPath(0));

        // create a new InputFormat instance if this is the first time to see this class
        inputFormatClassName = part.getInputFileFormatClass().getName();
      }

      out.writeUTF(inputFormatClassName);
    }
View Full Code Here

    JobConf newjob = new JobConf(job);
    ArrayList<InputSplit> result = new ArrayList<InputSplit>();

    // for each dir, get the InputFormat, and do getSplits.
    for(Path dir: dirs) {
      partitionDesc part = getPartitionDescFromPath(pathToPartitionInfo, dir);
      // create a new InputFormat instance if this is the first time to see this class
      Class inputFormatClass = part.getInputFileFormatClass();
      InputFormat inputFormat = getInputFormatFromCache(inputFormatClass, job);

      FileInputFormat.setInputPaths(newjob, dir);
      newjob.setInputFormat(inputFormat.getClass());
      InputSplit[] iss = inputFormat.getSplits(newjob, numSplits/dirs.length);
View Full Code Here

    }
    JobConf newjob = new JobConf(job);

    // for each dir, get the InputFormat, and do validateInput.
    for (Path dir: dirs) {
      partitionDesc part = getPartitionDescFromPath(pathToPartitionInfo, dir);
      // create a new InputFormat instance if this is the first time to see this class
      InputFormat inputFormat = getInputFormatFromCache(part.getInputFileFormatClass(), job);

      FileInputFormat.setInputPaths(newjob, dir);
      newjob.setInputFormat(inputFormat.getClass());
      ShimLoader.getHadoopShims().inputFormatValidateInput(inputFormat, newjob);
    }
View Full Code Here

    }
  }

  protected static partitionDesc getPartitionDescFromPath(Map<String, partitionDesc> pathToPartitionInfo,
                                                  Path dir) throws IOException {
    partitionDesc partDesc = pathToPartitionInfo.get(dir.toString());
    if (partDesc == null) {
      partDesc = pathToPartitionInfo.get(dir.toUri().getPath());
    }
    if (partDesc == null) {
      throw new IOException("cannot find dir = " + dir.toString() + " in partToPartitionInfo!");
View Full Code Here

TOP

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

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.