Package org.apache.hadoop.hive.metastore.api

Examples of org.apache.hadoop.hive.metastore.api.InvalidObjectException$InvalidObjectExceptionTupleScheme


        logStartFunction("create_table: db=" + tbl.getDbName() + " tbl=" + tbl.getTableName());
        boolean success = false;
        if(!MetaStoreUtils.validateName(tbl.getTableName()) ||
            !MetaStoreUtils.validateColNames(tbl.getSd().getCols()) ||
             (tbl.getPartitionKeys() != null && !MetaStoreUtils.validateColNames(tbl.getPartitionKeys()))) {
            throw new InvalidObjectException(tbl.getTableName() + " is not a valid object name");
        }
        try {
          getMS().openTransaction();
          Path tblPath = null;
          if(tbl.getSd().getLocation() == null || tbl.getSd().getLocation().isEmpty()) {
View Full Code Here


          part.setTableName(tableName);
          part.setValues(part_vals);

          Table tbl = getMS().getTable(part.getDbName(), part.getTableName());
          if(tbl == null) {
            throw new InvalidObjectException("Unable to add partition because table or database do not exist");
          }

          part.setSd(tbl.getSd());
          Path partLocation = new Path(tbl.getSd().getLocation(), Warehouse.makePartName(tbl.getPartitionKeys(), part_vals));
          part.getSd().setLocation(partLocation.toString());
View Full Code Here

          if( old_part != null) {
            throw new AlreadyExistsException("Partition already exists:" + part);
          }
          Table tbl = getMS().getTable(part.getDbName(), part.getTableName());
          if(tbl == null) {
            throw new InvalidObjectException("Unable to add partition because table or database do not exist");
          }
          // add partition
          success = getMS().addPartition(part);
          if(success) {
            success = getMS().commitTransaction();
View Full Code Here

    Properties p = MetaStoreUtils.getSchema(tbl);
    try {
      DB db = new DB(tbl.getDbName(), conf);
      RWTable.create(db, tbl.getTableName(), p, conf);
    } catch (UnknownDBException e) {
      throw new InvalidObjectException(e.getMessage());
    }
  }
View Full Code Here

      part = getPartitionObject(dbName, tableName, partVals);
      wh.mkdirs(new Path(part.getSd().getLocation())); // this will throw an exception if the dir couldn't be created
      return part;
    } catch (NoSuchObjectException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new InvalidObjectException("table or database doesn't exist");
    }
  }
View Full Code Here

    MDatabase mdb = null;
    try {
      mdb = getMDatabase(tbl.getDbName());
    } catch (NoSuchObjectException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new InvalidObjectException("Database " + tbl.getDbName()
          + " doesn't exist.");
    }

    // If the table has property EXTERNAL set, update table type
    // accordingly
View Full Code Here

    if (part == null) {
      return null;
    }
    MTable mt = getMTable(part.getDbName(), part.getTableName());
    if (mt == null) {
      throw new InvalidObjectException(
          "Partition doesn't have a valid table or database name");
    }

    // If this partition's set of columns is the same as the parent table's,
    // use the parent table's, so we do not create a duplicate column descriptor,
View Full Code Here

      openTransaction();
      name = name.toLowerCase();
      dbname = dbname.toLowerCase();
      MTable newt = convertToMTable(newTable);
      if (newt == null) {
        throw new InvalidObjectException("new table is invalid");
      }

      MTable oldt = getMTable(dbname, name);
      if (oldt == null) {
        throw new MetaException("table " + name + " doesn't exist");
View Full Code Here

      name = name.toLowerCase();
      baseTblName = baseTblName.toLowerCase();
      dbname = dbname.toLowerCase();
      MIndex newi = convertToMIndex(newIndex);
      if (newi == null) {
        throw new InvalidObjectException("new index is invalid");
      }

      MIndex oldi = getMIndex(dbname, baseTblName, name);
      if (oldi == null) {
        throw new MetaException("index " + name + " doesn't exist");
View Full Code Here

    name = name.toLowerCase();
    dbname = dbname.toLowerCase();
    MPartition oldp = getMPartition(dbname, name, part_vals);
    MPartition newp = convertToMPart(newPart, false);
    if (oldp == null || newp == null) {
      throw new InvalidObjectException("partition does not exist.");
    }
    oldp.setValues(newp.getValues());
    oldp.setPartitionName(newp.getPartitionName());
    oldp.setParameters(newPart.getParameters());
    if (!TableType.VIRTUAL_VIEW.name().equals(oldp.getTable().getTableType())) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.InvalidObjectException$InvalidObjectExceptionTupleScheme

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.