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

Examples of org.apache.hadoop.hive.metastore.api.MetaException


        throw new InvalidObjectException("new table is invalid");
      }
     
      MTable oldt = this.getMTable(dbname, name);
      if(oldt == null) {
        throw new MetaException("table " + name + " doesn't exist");
      }
     
      // For now only alter name, owner, paramters, cols, bucketcols are allowed
      oldt.setTableName(newt.getTableName().toLowerCase());
      oldt.setParameters(newt.getParameters());
View Full Code Here


    }
   
    try {
      this.store_.drop(this.parent_, this.tableName_);
    } catch(IOException e) {
      throw new MetaException(e.getMessage());
    }
    this.o_rdonly_ = true; // the table is dropped, so can only do reads now
  }
View Full Code Here

      // ensure the directory is re-made
      if (partition == null || partition.length() == 0) {
        this.whPath_.getFileSystem(this.conf_).mkdirs(this.whPath_);
      }
    } catch(IOException e) {
      throw new MetaException(e.getMessage());
    }
  }
View Full Code Here

    newTable.o_rdonly_ = false;
    newTable.schema_ = schema;
    newTable.store_ = new FileStore(conf);

    if(MetaStoreUtils.validateName(tableName) == false) {
      throw new MetaException("Invalid table name: " + tableName + " - allowed characters are \\w and _") ;
    }

    String location = schema.getProperty(Constants.META_TABLE_LOCATION);

    if(location == null) {
      newTable.whPath_ = parent.getDefaultTablePath(tableName, (String)null);
      newTable.schema_.setProperty(Constants.META_TABLE_LOCATION, newTable.whPath_.toUri().toASCIIString());
    } else {
      newTable.whPath_ = new Path(location);
    }

    try {
      if (newTable.whPath_.getFileSystem(conf).exists(newTable.whPath_)) {
        // current unit tests will fail
        // throw new MetaException("for new table: " + tableName + " " + newTable.whPath_ + " already exists cannot create??");
      } else {
        newTable.whPath_.getFileSystem(conf).mkdirs(newTable.whPath_);
      }
    } catch(IOException e) {
      LOG.error(StringUtils.stringifyException(e));
      throw new MetaException(e.getMessage());
    }

    newTable.save(false);
    return newTable;
  }
View Full Code Here

        e.printStackTrace();
        throw new TApplicationException("MetaException getting tables:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_tables got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_tables had an internal Java RuntimeException: " + e.getMessage());
      }
    }
View Full Code Here

        e.printStackTrace();
        throw new TApplicationException("MetaException getting dbs:" + e.getMessage());
      } catch(RuntimeException e) {
        LOG.fatal("get_dbs got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("get_dbs had an internal Java RuntimeException: " + e.getMessage());
      }
    }
View Full Code Here

        this.incrementCounter("exceptions");
        throw e;
      } catch(RuntimeException e) {
        LOG.fatal("schema_exists got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("schema_exists had an internal Java RuntimeException: " + e.getMessage());
      }
    }
View Full Code Here

        this.incrementCounter("exceptions");
        throw e;
      } catch(RuntimeException e) {
        LOG.fatal("alter_table got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("alter_table had an internal Java RuntimeException: " + e.getMessage());
      }
    }
View Full Code Here

        this.incrementCounter("exceptions");
        throw e;
      } catch(RuntimeException e) {
        LOG.fatal("create_table got a runtime exception: " + e.getMessage());
        MetaStoreUtils.printStackTrace(e);
        throw new MetaException("create_table had an internal Java RuntimeException: " + e.getMessage());
      }
    }
View Full Code Here

        }
        return str_fields;

      } catch(SerDeException e) {
        StringUtils.stringifyException(e);
        MetaException m = new MetaException();
        m.setMessage(e.getMessage());
        throw m;
      }

    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.MetaException

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.