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

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


      sortCols = getColumnNamesOrder((ASTNode) buckets.getChild(1));
      numBuckets = (Integer.valueOf(buckets.getChild(2).getText())).intValue();
    }
    if(numBuckets <=0 )
      throw new SemanticException(ErrorMsg.INVALID_BUCKET_NUMBER.getMsg());
    alterTableDesc alterTblDesc = new alterTableDesc(tableName, numBuckets, bucketCols, sortCols);
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));
  }
View Full Code Here


    setFetchTask(createFetchTask(descFuncDesc.getSchema()));
  }

  private void analyzeAlterTableRename(ASTNode ast)
  throws SemanticException {
    alterTableDesc alterTblDesc = new alterTableDesc(
        unescapeIdentifier(ast.getChild(0).getText()),
        unescapeIdentifier(ast.getChild(1).getText()));
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));
  }
View Full Code Here

        first = true;
      else
        flagCol = unescapeIdentifier(positionNode.getChild(0).getText());
    }
   
    alterTableDesc alterTblDesc = new alterTableDesc(tblName,
        unescapeIdentifier(ast.getChild(1).getText()),
        unescapeIdentifier(ast.getChild(2).getText()), newType, newComment, first, flagCol);
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));
  }
View Full Code Here

  private void analyzeAlterTableModifyCols(ASTNode ast, alterTableTypes alterType)
  throws SemanticException {
    String tblName = unescapeIdentifier(ast.getChild(0).getText());
    List<FieldSchema> newCols = getColumns((ASTNode)ast.getChild(1));
    alterTableDesc alterTblDesc = new alterTableDesc(tblName, newCols, alterType);
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));
  }
View Full Code Here

      dropTableDesc dropTbl = work.getDropTblDesc();
      if (dropTbl != null) {
        return dropTable(db, dropTbl);
      }

      alterTableDesc alterTbl = work.getAlterTblDesc();
      if (alterTbl != null) {
        return alterTable(db, alterTbl);
      }
     
      AddPartitionDesc addPartitionDesc = work.getAddPartitionDesc();
View Full Code Here

  }

  private void analyzeAlterTableProps(ASTNode ast) throws SemanticException {
    String tableName = unescapeIdentifier(ast.getChild(0).getText());   
    HashMap<String, String> mapProp = getProps((ASTNode)(ast.getChild(1)).getChild(0));
    alterTableDesc alterTblDesc = new alterTableDesc(alterTableTypes.ADDPROPS);
    alterTblDesc.setProps(mapProp);
    alterTblDesc.setOldName(tableName);
    rootTasks.add(TaskFactory.get(new DDLWork(alterTblDesc), conf));
  }
View Full Code Here

  }

  private void analyzeAlterTableSerdeProps(ASTNode ast) throws SemanticException {
    String tableName = unescapeIdentifier(ast.getChild(0).getText());   
    HashMap<String, String> mapProp = getProps((ASTNode)(ast.getChild(1)).getChild(0));
    alterTableDesc alterTblDesc = new alterTableDesc(alterTableTypes.ADDSERDEPROPS);
    alterTblDesc.setProps(mapProp);
    alterTblDesc.setOldName(tableName);
    rootTasks.add(TaskFactory.get(new DDLWork(alterTblDesc), conf));
  }
View Full Code Here

  }

  private void analyzeAlterTableSerde(ASTNode ast) throws SemanticException {
    String tableName = unescapeIdentifier(ast.getChild(0).getText());   
    String serdeName = unescapeSQLString(ast.getChild(1).getText());
    alterTableDesc alterTblDesc = new alterTableDesc(alterTableTypes.ADDSERDE);
    if(ast.getChildCount() > 2) {
      HashMap<String, String> mapProp = getProps((ASTNode)(ast.getChild(2)).getChild(0));
      alterTblDesc.setProps(mapProp);
    }
    alterTblDesc.setOldName(tableName);
    alterTblDesc.setSerdeName(serdeName);
    rootTasks.add(TaskFactory.get(new DDLWork(alterTblDesc), conf));
  }
View Full Code Here

    setFetchTask(createFetchTask(descFuncDesc.getSchema()));
  }

  private void analyzeAlterTableRename(ASTNode ast)
  throws SemanticException {
    alterTableDesc alterTblDesc = new alterTableDesc(
        unescapeIdentifier(ast.getChild(0).getText()),
        unescapeIdentifier(ast.getChild(1).getText()));
    rootTasks.add(TaskFactory.get(new DDLWork(alterTblDesc), conf));
  }
View Full Code Here

  private void analyzeAlterTableModifyCols(ASTNode ast, alterTableTypes alterType)
  throws SemanticException {
    String tblName = unescapeIdentifier(ast.getChild(0).getText());
    List<FieldSchema> newCols = getColumns((ASTNode)ast.getChild(1));
    alterTableDesc alterTblDesc = new alterTableDesc(tblName, newCols, alterType);
    rootTasks.add(TaskFactory.get(new DDLWork(alterTblDesc), conf));
  }
View Full Code Here

TOP

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

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.