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

Examples of org.apache.hadoop.hive.metastore.api.UnknownTableException$UnknownTableExceptionStandardScheme


      Table tbl;
      try {
        tbl = get_table(db, base_table_name);
      } catch (NoSuchObjectException e) {
        throw new UnknownTableException(e.getMessage());
      }
      List<FieldSchema> fieldSchemas = get_fields(db, base_table_name);

      if (tbl == null || fieldSchemas == null) {
        throw new UnknownTableException(tableName + " doesn't exist");
      }

      if (tbl.getPartitionKeys() != null) {
        // Combine the column field schemas and the partition keys to create the
        // whole schema
View Full Code Here


    return store_.getTablesByPattern(this, tablePattern);
  }

  public Table getTable(String tableName, boolean o_rdonly) throws MetaException, UnknownTableException {
    if(store_.tableExists(this.dbName_, tableName) == false) {
      throw new UnknownTableException(tableName + " doesn't exist in database " + dbName_);
    }
    return new Table(this, tableName, conf_, o_rdonly);
  }
View Full Code Here

    conf_ = conf;
    store_ = new FileStore(conf); // only choice for now

    // check and load the schema
    if(store_.tableExists(parent_.getName(), tableName) == false) {
      throw new UnknownTableException("metadata does not exist");
    }
    schema_ = store_.load(parent, tableName);

    // check the table location is on the default dfs server for safety
    whPath_ = new Path(schema_.getProperty(Constants.META_TABLE_LOCATION));
    if(whPath_.toUri().relativize(parent.whRoot_.toUri()) == null) {
      // something potentially wrong as the stored warehouse not the same as our default
      // in general we want this, but in the short term, it can't happen
      LOG.warn(whPath_ + " is not the current default fs");
    }

    // check the data directory is there
    try {
      if(whPath_.getFileSystem(conf).exists(whPath_) == false) {
        throw new UnknownTableException("data does not exist:" + whPath_);
      }
    } catch(IOException e) {
      // ignore
    }
  }
View Full Code Here

      try {
        this.open(store);
        try {
          client.drop_table(dbName, tableName);
        } catch(UnknownDBException e) {
          throw new UnknownTableException();
        }
        close();
        return;
      catch(TException e) {
        System.err.println("get_tables got exception: " + e);
View Full Code Here

      try {
        this.open(store);
        try {
          client.create_table(dbName, tableName, hm);
        } catch(UnknownDBException e) {
          throw new UnknownTableException();
        }
        close();
        return;
      } catch(TException e) {
        System.err.println("get_tables got exception: " + e);
View Full Code Here

    Properties schema = new Properties();

    File schemaFile = getSchemaFile(parent.getName(), tableName);

    if(schemaFile.exists() == false) {
      throw new UnknownTableException();
    }

    try {
      FileInputStream fis = new FileInputStream(schemaFile);
      schema.load(fis);
View Full Code Here

        Table tbl;
        try {
          tbl = this.get_table(db, base_table_name);
        } catch (NoSuchObjectException e) {
          throw new UnknownTableException(e.getMessage());
        }
        try {
          Deserializer s = MetaStoreUtils.getDeserializer(this.hiveConf, tbl);
          return MetaStoreUtils.getFieldsFromDeserializer(tableName, s);
        } catch(SerDeException e) {
View Full Code Here

        Table tbl;
        try {
          tbl = this.get_table(db, base_table_name);
        } catch (NoSuchObjectException e) {
          throw new UnknownTableException(e.getMessage());
        }
        boolean isNative = SerDeUtils.isNativeSerDe(tbl.getSd().getSerdeInfo().getSerializationLib());
        if (isNative)
          return tbl.getSd().getCols();
        else {
View Full Code Here

       
        Table tbl;
        try {
          tbl = this.get_table(db, base_table_name);
        } catch (NoSuchObjectException e) {
          throw new UnknownTableException(e.getMessage());
        }
        List<FieldSchema> fieldSchemas = this.get_fields(db, base_table_name);

        if (tbl == null || fieldSchemas == null) {
          throw new UnknownTableException(tableName + " doesn't exist");
        }
       
        if (tbl.getPartitionKeys() != null) {
          // Combine the column field schemas and the partition keys to create the whole schema
          fieldSchemas.addAll(tbl.getPartitionKeys());
View Full Code Here

      List<FieldSchema> ret = null;
      try {
        try {
          tbl = get_table(db, base_table_name);
        } catch (NoSuchObjectException e) {
          throw new UnknownTableException(e.getMessage());
        }
        boolean getColsFromSerDe = SerDeUtils.shouldGetColsFromSerDe(
            tbl.getSd().getSerdeInfo().getSerializationLib());
        if (!getColsFromSerDe) {
          ret = tbl.getSd().getCols();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.metastore.api.UnknownTableException$UnknownTableExceptionStandardScheme

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.