Examples of dropTable()


Examples of org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable()

    client = context.getMetaStoreClient(USER1_1);
    createMetastoreTable(client, dbName, tabName2,
        Lists.newArrayList(new FieldSchema("col1", "int", "")));
    assertEquals(1, client.getTables(dbName, tabName2).size());
    client.dropTable(dbName, tabName1);
    createMetastoreTable(client, dbName, tabName1,
        Lists.newArrayList(new FieldSchema("col1", "int", "")));
    client.close();

    // group2 users can't create the table, but can drop it
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable()

          Lists.newArrayList(new FieldSchema("col1", "int", "")));
      fail("Create table should have failed for non-privilege user");
    } catch (MetaException e) {
      Context.verifyMetastoreAuthException(e);
    }
    client.dropTable(dbName, tabName2);
    client.close();

    // group3 users can't create or drop it
    client = context.getMetaStoreClient(USER3_1);
    try {
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable()

    } catch (MetaException e) {
      Context.verifyMetastoreAuthException(e);
    }

    try {
      client.dropTable(dbName, tabName1);
      fail("drop table should have failed for non-privilege user");
    } catch (MetaException e) {
      Context.verifyMetastoreAuthException(e);
    }
    client.close();
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

        return 0;

      } catch (Exception e){
          ss.err.println(String.format("Failed to set permissions/groups on TABLE: <%s> %s",tblName,e.getMessage()));
          try // We need to drop the table.
            if(null != db){ db.dropTable(tblName); }
          } catch (HiveException he) {
            ss.err.println(String.format("Failed to drop TABLE <%s> after failing to set permissions/groups on it. %s",tblName,e.getMessage()));
          }
          return 1;
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

        return 0;

      } catch (Exception e){
          ss.err.println(String.format("Failed to set permissions/groups on TABLE: <%s> %s",tblName,e.getMessage()));
          try // We need to drop the table.
            if(null != db){ db.dropTable(tblName); }
          } catch (HiveException he) {
            ss.err.println(String.format("Failed to drop TABLE <%s> after failing to set permissions/groups on it. %s",tblName,e.getMessage()));
          }
          return 1;
      }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

            } catch (Exception e) {
                ss.err.println(String.format("Failed to set permissions/groups on TABLE: <%s> %s", tblName, e.getMessage()));
                try // We need to drop the table.
                    if (null != db) {
                        db.dropTable(tblName);
                    }
                } catch (HiveException he) {
                    ss.err.println(String.format("Failed to drop TABLE <%s> after failing to set permissions/groups on it. %s", tblName, e.getMessage()));
                }
                return 1;
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

      dropTableDesc dropTbl = work.getDropTblDesc();
      if (dropTbl != null) {
        if(dropTbl.getPartSpecs() == null) {
          // drop the table
          db.dropTable(dropTbl.getTableName());
        } else {
          // drop partitions in the list
          Table tbl  = db.getTable(dropTbl.getTableName());
          List<Partition> parts = new ArrayList<Partition>();
          for(HashMap<String, String> partSpec : dropTbl.getPartSpecs()) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

      } catch (Exception e) {
        ss.err.println(String.format("Failed to set permissions/groups on TABLE: <%s> %s", tblName, e.getMessage()));
        try // We need to drop the table.
          if (null != db) {
            db.dropTable(tblName);
          }
        } catch (HiveException he) {
          ss.err.println(String.format("Failed to drop TABLE <%s> after failing to set permissions/groups on it. %s", tblName, e.getMessage()));
        }
        return 1;
View Full Code Here

Examples of org.apache.hadoop.hive.ql.metadata.Hive.dropTable()

      } catch (Exception e) {
        ss.err.println(String.format("Failed to set permissions/groups on TABLE: <%s> %s", tblName, e.getMessage()));
        try // We need to drop the table.
          if (null != db) {
            db.dropTable(tblName);
          }
        } catch (HiveException he) {
          ss.err.println(String.format("Failed to drop TABLE <%s> after failing to set permissions/groups on it. %s", tblName, e.getMessage()));
        }
        return 1;
View Full Code Here

Examples of org.apache.hcatalog.api.HCatClient.dropTable()

    }

    public static void dropTable(String metaStoreUrl, String databaseName,
                                 String tableName) throws Exception {
        HCatClient client = HiveCatalogService.get(metaStoreUrl);
        client.dropTable(databaseName, tableName, true);
    }

    public static void startSessionState(String metaStoreUrl) {
        HiveConf hcatConf = new HiveConf();
        hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreUrl);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.