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

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


      if (oi instanceof StructObjectInspector) {
        StructObjectInspector soi = (StructObjectInspector)oi;
        StructField sf = soi.getStructFieldRef(names[i]);
        if (sf == null) {
          throw new MetaException("Invalid Field " + names[i]);
        } else {
          oi = sf.getFieldObjectInspector();
        }
      }
      else if (oi instanceof ListObjectInspector && names[i].equalsIgnoreCase("$elem$")) {
        ListObjectInspector loi = (ListObjectInspector)oi;
        oi = loi.getListElementObjectInspector();
      }
      else if (oi instanceof MapObjectInspector && names[i].equalsIgnoreCase("$key$")) {
        MapObjectInspector moi = (MapObjectInspector)oi;
        oi = moi.getMapKeyObjectInspector();
      }
      else if (oi instanceof MapObjectInspector && names[i].equalsIgnoreCase("$value$")) {
        MapObjectInspector moi = (MapObjectInspector)oi;
        oi = moi.getMapValueObjectInspector();
       }
      else {
        throw new MetaException("Unknown type for " + names[i]);
      }
    }

    ArrayList<FieldSchema> str_fields = new ArrayList<FieldSchema>();
    // rules on how to recurse the ObjectInspector based on its type
View Full Code Here


    FileStatus[] dirs;

    try {
      dirs = whPath_.getFileSystem(conf_).listStatus(whPath_);
    } catch (IOException e) {
      throw new MetaException("DB Error: Table " + whPath_ + " missing?");
    }

    if(dirs == null) {
      throw new MetaException("FATAL: " + whPath_ + " does not seem to exist or maybe has no partitions in DFS");
    }


    Boolean equalsSeen = null;
    String partKey = null;

    for (int i = 0; i < dirs.length; i++) {
      String dname = dirs[i].getPath().getName();
      int sepidx = dname.indexOf('=');
      if (sepidx == -1) {
        if (equalsSeen != null && equalsSeen.booleanValue()) {
          throw new MetaException("DB Error: Table "+tableName_+" dir corrupted?");
        }
        equalsSeen = Boolean.valueOf(false);
        continue;
      } else {
        if (equalsSeen != null && !equalsSeen.booleanValue()) {
          throw new MetaException("DB Error: Table "+tableName_+" dir corrupted?");
        }
        equalsSeen = Boolean.valueOf(true);
      }
      String partVal = dname.substring(sepidx+1);
      if (partKey != null) {
        if (!partKey.equals(dname.substring(0,sepidx))) {
          throw new MetaException("DB Error: Directory "+dirs[i]);
        }
      } else {
        partKey = dname.substring(0,sepidx);
      }
View Full Code Here

    return tPartition;
  }

  public void alter_table(String defaultDatabaseName, String tblName, Table table)
      throws InvalidOperationException, MetaException, TException {
    throw new MetaException("Not yet implementd in filestore");
  }
View Full Code Here

      private Class<?> getClass(String rawStoreClassName, Class<RawStore> class1) throws MetaException {
        try {
          return Class.forName(rawStoreClassName, true, classLoader);
        } catch (ClassNotFoundException e) {
          throw new MetaException(rawStoreClassName + " class not found");
        }
      }
View Full Code Here

      public boolean drop_database(String name) throws MetaException {
        this.incrementCounter("drop_database");
        logStartFunction("drop_database: " + name);
        if(name.equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) {
          throw new MetaException("Can't drop default database");
        }
        boolean success = false;
        try {
          getMS().openTransaction();
          if(getMS().dropDatabase(name)) {
View Full Code Here

      public Map<String, Type> get_type_all(String name) throws MetaException {
        this.incrementCounter("get_type_all");
        // TODO Auto-generated method stub
        logStartFunction("get_type_all");
        throw new MetaException("Not yet implemented");
      }
View Full Code Here

          tbl = get_table(dbname, name);
          if (tbl == null) {
            throw new NoSuchObjectException(name + " doesn't exist");
          }
          if(tbl.getSd() == null  || tbl.getSd().getLocation() == null) {
            throw new MetaException("Table metadata is corrupted");
          }
          if(!getMS().dropTable(dbname, name)) {
            throw new MetaException("Unable to drop table");
          }
          success  = getMS().commitTransaction();
          tblPath = new Path(tbl.getSd().getLocation());
        } finally {
          if(!success) {
View Full Code Here

          Partition part = this.get_partition(db_name, tbl_name, part_vals);
          if(part == null) {
            throw new NoSuchObjectException("Partition doesn't exist. " + part_vals);
          }
          if(part.getSd() == null  || part.getSd().getLocation() == null) {
            throw new MetaException("Partition metadata is corrupted");
          }
          if(!getMS().dropPartition(db_name, tbl_name, part_vals)) {
            throw new MetaException("Unable to drop partition");
          }
          success  = getMS().commitTransaction();
          partPath = new Path(part.getSd().getLocation());
          tbl = get_table(db_name, tbl_name);
        } finally {
View Full Code Here

      public boolean alter_partitions(StorageDescriptor sd, List<String> parts) throws InvalidOperationException,
          MetaException {
        this.incrementCounter("alter_partitions");
        logStartFunction("alter_partitions");
        // TODO Auto-generated method stub
        throw new MetaException("Not yet implemented");
      }
View Full Code Here

      public boolean set_partition_parameters(String db_name, String tbl_name, String pname, Map<String, String> params) throws NoSuchObjectException,
          MetaException {
        this.incrementCounter("set_partition_parameters");
        logStartFunction("set_partition_parameters: db=" + db_name + " tbl=" + tbl_name);
        // TODO Auto-generated method stub
        throw new MetaException("Not yet implemented");
      }
View Full Code Here

TOP

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

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.