Package org.apache.hcatalog.common

Examples of org.apache.hcatalog.common.HCatException


            }
        } catch (NoSuchObjectException exp) {
            throw new ObjectNotFoundException(
                "NoSuchObjectException while fetching database", exp);
        } catch (MetaException exp) {
            throw new HCatException("MetaException while fetching database",
                exp);
        } catch (TException exp) {
            throw new ConnectionFailureException(
                "TException while fetching database", exp);
        }
View Full Code Here


    public void createDatabase(HCatCreateDBDesc dbInfo) throws HCatException {
        try {
            hmsClient.createDatabase(dbInfo.toHiveDb());
        } catch (AlreadyExistsException exp) {
            if (!dbInfo.getIfNotExists()) {
                throw new HCatException(
                    "AlreadyExistsException while creating database", exp);
            }
        } catch (InvalidObjectException exp) {
            throw new HCatException(
                "InvalidObjectException while creating database", exp);
        } catch (MetaException exp) {
            throw new HCatException("MetaException while creating database",
                exp);
        } catch (TException exp) {
            throw new ConnectionFailureException(
                "TException while creating database", exp);
        }
View Full Code Here

            if (!ifExists) {
                throw new ObjectNotFoundException(
                    "NoSuchObjectException while dropping db.", e);
            }
        } catch (InvalidOperationException e) {
            throw new HCatException(
                "InvalidOperationException while dropping db.", e);
        } catch (MetaException e) {
            throw new HCatException("MetaException while dropping db.", e);
        } catch (TException e) {
            throw new ConnectionFailureException("TException while dropping db.",
                e);
        }
    }
View Full Code Here

                                                String tablePattern) throws HCatException {
        List<String> tableNames = null;
        try {
            tableNames = hmsClient.getTables(checkDB(dbName), tablePattern);
        } catch (MetaException e) {
            throw new HCatException(
                "MetaException while fetching table names.", e);
        }
        return tableNames;
    }
View Full Code Here

            Table hiveTable = hmsClient.getTable(checkDB(dbName), tableName);
            if (hiveTable != null) {
                table = new HCatTable(hiveTable);
            }
        } catch (MetaException e) {
            throw new HCatException("MetaException while fetching table.", e);
        } catch (NoSuchObjectException e) {
            throw new ObjectNotFoundException(
                "NoSuchObjectException while fetching table.", e);
        } catch (TException e) {
            throw new ConnectionFailureException(
View Full Code Here

        throws HCatException {
        try {
            hmsClient.createTable(createTableDesc.toHiveTable(hiveConfig));
        } catch (AlreadyExistsException e) {
            if (!createTableDesc.getIfNotExists()) {
                throw new HCatException(
                    "AlreadyExistsException while creating table.", e);
            }
        } catch (InvalidObjectException e) {
            throw new HCatException(
                "InvalidObjectException while creating table.", e);
        } catch (MetaException e) {
            throw new HCatException("MetaException while creating table.", e);
        } catch (NoSuchObjectException e) {
            throw new ObjectNotFoundException(
                "NoSuchObjectException while creating table.", e);
        } catch (TException e) {
            throw new ConnectionFailureException(
                "TException while creating table.", e);
        } catch (IOException e) {
            throw new HCatException("IOException while creating hive conf.", e);
        }

    }
View Full Code Here

            Table table = hmsClient.getTable(dbName, tableName);
            table.getSd().setCols(HCatSchemaUtils.getFieldSchemas(columnSchema));
            hmsClient.alter_table(dbName, tableName, table);
        }
        catch (InvalidOperationException e) {
            throw new HCatException("InvalidOperationException while updating table schema.", e);
        }
        catch (MetaException e) {
            throw new HCatException("MetaException while updating table schema.", e);
        }
        catch (NoSuchObjectException e) {
            throw new ObjectNotFoundException(
                    "NoSuchObjectException while updating table schema.", e);
        }
View Full Code Here

        if (hiveTable != null) {
            try {
                hmsClient.createTable(hiveTable);
            } catch (AlreadyExistsException e) {
                if (!ifNotExists) {
                    throw new HCatException(
                        "A table already exists with the name "
                            + newTableName, e);
                }
            } catch (InvalidObjectException e) {
                throw new HCatException(
                    "InvalidObjectException in create table like command.",
                    e);
            } catch (MetaException e) {
                throw new HCatException(
                    "MetaException in create table like command.", e);
            } catch (NoSuchObjectException e) {
                throw new ObjectNotFoundException(
                    "NoSuchObjectException in create table like command.",
                    e);
View Full Code Here

            if (!ifExists) {
                throw new ObjectNotFoundException(
                    "NoSuchObjectException while dropping table.", e);
            }
        } catch (MetaException e) {
            throw new HCatException("MetaException while dropping table.", e);
        } catch (TException e) {
            throw new ConnectionFailureException(
                "TException while dropping table.", e);
        }
    }
View Full Code Here

            if (oldtbl != null) {
                // TODO : Should be moved out.
                if (oldtbl
                    .getParameters()
                    .get(org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_STORAGE) != null) {
                    throw new HCatException(
                        "Cannot use rename command on a non-native table");
                }
                tbl = new Table(oldtbl);
                tbl.setTableName(newName);
                hmsClient.alter_table(checkDB(dbName), oldName, tbl);
            }
        } catch (MetaException e) {
            throw new HCatException("MetaException while renaming table", e);
        } catch (NoSuchObjectException e) {
            throw new ObjectNotFoundException(
                "NoSuchObjectException while renaming table", e);
        } catch (InvalidOperationException e) {
            throw new HCatException(
                "InvalidOperationException while renaming table", e);
        } catch (TException e) {
            throw new ConnectionFailureException(
                    "TException while renaming table", e);
        }
View Full Code Here

TOP

Related Classes of org.apache.hcatalog.common.HCatException

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.