@Override public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { // First check temp tables org.apache.hadoop.hive.metastore.api.Table table = getTempTable(databaseName, tableName); if (table != null) { return true; } // Try underlying client return super.tableExists(databaseName, tableName); }
@Override public boolean tableExists(String databaseName, String tableName) throws TException { return tableExists(getDefaultCatalog(conf), databaseName, tableName); }
@Override public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { // First check temp tables org.apache.hadoop.hive.metastore.api.Table table = getTempTable(databaseName, tableName); if (table != null) { return true; } // Try underlying client return super.tableExists(databaseName, tableName); }
private static void createTable(HiveMetaStoreClient hmsc, boolean enablePartitionGrouping) throws Exception { List<FieldSchema> columns = new ArrayList<>(); columns.add(new FieldSchema("foo", "string", "")); columns.add(new FieldSchema("bar", "string", "")); List<FieldSchema> partColumns = new ArrayList<>(); partColumns.add(new FieldSchema("dt", "string", "")); partColumns.add(new FieldSchema("blurb", "string", "")); SerDeInfo serdeInfo = new SerDeInfo("LBCSerDe", "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", new HashMap<>()); StorageDescriptor storageDescriptor = new StorageDescriptor(columns, null, "org.apache.hadoop.hive.ql.io.RCFileInputFormat", "org.apache.hadoop.hive.ql.io.RCFileOutputFormat", false, 0, serdeInfo, null, null, null); Map<String, String> tableParameters = new HashMap<>(); tableParameters.put("hive.hcatalog.partition.spec.grouping.enabled", enablePartitionGrouping? "true":"false"); Table table = new Table(tableName, dbName, "", 0, 0, 0, storageDescriptor, partColumns, tableParameters, "", "", ""); hmsc.createTable(table); Assert.assertTrue("Table " + dbName + "." + tableName + " does not exist", hmsc.tableExists(dbName, tableName)); }
private void createTestTables() throws TException { if (client.tableExists(dbName, tblName)) { LOG.info("Table is already existing. Dropping it and then recreating"); client.dropTable(dbName, tblName); client.tableExists(dbName, tblName));
@Override public Boolean call() throws TException { return client.tableExists(dbName, tableName); } };
@Override public Boolean call() throws TException { return client.tableExists(dbName, tableName); } };
/** {@inheritDoc} */ @Deprecated public boolean tableExists(String tableName) throws MetaException, TException, UnknownDBException { return tableExists(DEFAULT_DATABASE_NAME, tableName); }
/** {@inheritDoc} */ @Override @Deprecated public boolean tableExists(String tableName) throws MetaException, TException, UnknownDBException { return tableExists(DEFAULT_DATABASE_NAME, tableName); }
/** {@inheritDoc} */ @Deprecated public boolean tableExists(String tableName) throws MetaException, TException, UnknownDBException { return tableExists(DEFAULT_DATABASE_NAME, tableName); }
/** {@inheritDoc} */ @Override @Deprecated public boolean tableExists(String tableName) throws MetaException, TException, UnknownDBException { return tableExists(DEFAULT_DATABASE_NAME, tableName); }
/** * @return true if the configured table exists */ boolean doesTableExist() { try { return client.tableExists(syncConfig.databaseName, syncConfig.tableName); } catch (TException e) { throw new HoodieHiveSyncException("Failed to check if table exists " + syncConfig.tableName, e); } }
@Override public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { // First check temp tables org.apache.hadoop.hive.metastore.api.Table table = getTempTable(databaseName, tableName); if (table != null) { return true; } // Try underlying client return super.tableExists(databaseName, tableName); }