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

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


      showFunctionsDesc showFuncs = work.getShowFuncsDesc();
      if (showFuncs != null) {
        return showFunctions(showFuncs);
      }

      showPartitionsDesc showParts = work.getShowPartsDesc();
      if (showParts != null) {
        return showPartitions(db, showParts);
      }

    } catch (InvalidTableException e) {
View Full Code Here


    LOG.info("analyzeDescribeTable done");
  }
 
  private void analyzeShowPartitions(ASTNode ast)
  throws SemanticException {
    showPartitionsDesc showPartsDesc;
    String tableName = unescapeIdentifier(ast.getChild(0).getText());
    showPartsDesc = new showPartitionsDesc(tableName, ctx.getResFile());
    rootTasks.add(TaskFactory.get(new DDLWork(showPartsDesc), conf));
    setFetchTask(createFetchTask(showPartsDesc.getSchema()));
  }
View Full Code Here

          return 1;
        }
        return 0;
      }

      showPartitionsDesc showParts = work.getShowPartsDesc();
      if (showParts != null) {
        // get the partitions for the table and populate the output
        String tabName = showParts.getTabName();
        Table tbl = null;
        List<String> parts = null;

        tbl = db.getTable(tabName);

        if (!tbl.isPartitioned()) {
          console.printError("Table " + tabName + " is not a partitioned table");
          return 1;
        }

        parts = db.getPartitionNames(MetaStoreUtils.DEFAULT_DATABASE_NAME, tbl.getName(), Short.MAX_VALUE);

        // write the results in the file
        try {
          DataOutput outStream = (DataOutput)fs.create(showParts.getResFile());
          Iterator<String> iterParts = parts.iterator();
          boolean firstCol = true;
          while (iterParts.hasNext())
          {
            if (!firstCol)
View Full Code Here

    LOG.info("analyzeDescribeTable done");
  }
 
  private void analyzeShowPartitions(CommonTree ast)
  throws SemanticException {
    showPartitionsDesc showPartsDesc;
    String tableName = ast.getChild(0).getText();
    showPartsDesc = new showPartitionsDesc(tableName, ctx.getResFile());
    rootTasks.add(TaskFactory.get(new DDLWork(showPartsDesc), conf));
  }
View Full Code Here

TOP

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

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.