@Override public TableMetadata refresh() { String metadataLocation = null; try { final Table table = metaStoreClient.get_table(database, tableName); String tableType = table.getParameters().get(TABLE_TYPE_PROP); if (tableType == null || !tableType.equalsIgnoreCase(ICEBERG_TABLE_TYPE_VALUE)) { throw new IllegalArgumentException(format("Invalid tableName, not Iceberg: %s.%s", database, table)); } metadataLocation = table.getParameters().get(METADATA_LOCATION_PROP); if (metadataLocation == null) { throw new IllegalArgumentException(format("%s.%s is missing %s property", database, tableName, METADATA_LOCATION_PROP)); } } catch (NoSuchObjectException e) { if (currentMetadataLocation() != null) { throw new NoSuchTableException(format("No such table: %s.%s", database, tableName)); } } catch (TException e) { throw new RuntimeException(format("Failed to get table info from metastore %s.%s", database, tableName)); } refreshFromMetadataLocation(metadataLocation); return current(); }
tbl = metaStoreClient.get_table(database, tableName); } else { final long currentTimeMillis = System.currentTimeMillis();
void setStatistics(TableName tableName, TableStatistics tableStatistics) { try { Table table = client.get_table(getSchema(tableName), tableName.getSchemalessNameInDatabase()); setRowsCount(tableName, tableStatistics, table); try { setColumnStatistics(tableName, tableStatistics, table, fieldSchema -> true); } catch (TException ignore) { transport.close(); transport.open(); // try to avoid date type as it not supported in hive 1.1.0 setColumnStatistics(tableName, tableStatistics, table, fieldSchema -> !fieldSchema.getType().equals("date")); } } catch (TException e) { throw new RuntimeException(e); } }
/** * TODO. * * @param dbName TODO * @param tableName TODO * @return TODO * * @throws HiveMetastoreException TODO */ public synchronized Table getTable(String dbName, String tableName) throws HiveMetastoreException { try { connectIfNeeded(); return client.get_table(dbName, tableName); } catch (NoSuchObjectException e) { return null; } catch (TException e) { close(); throw new HiveMetastoreException(e); } }
void setStatistics(TableName tableName, TableStatistics tableStatistics) { try { Table table = client.get_table(getSchema(tableName), tableName.getSchemalessNameInDatabase()); setRowsCount(tableName, tableStatistics, table); try { setColumnStatistics(tableName, tableStatistics, table, fieldSchema -> true); } catch (TException ignore) { transport.close(); transport.open(); // try to avoid date type as it not supported in hive 1.1.0 setColumnStatistics(tableName, tableStatistics, table, fieldSchema -> !fieldSchema.getType().equals("date")); } } catch (TException e) { throw new RuntimeException(e); } }
/** * TODO. * * @param dbName TODO * @param tableName TODO * @return TODO * * @throws HiveMetastoreException TODO */ public synchronized Table getTable(String dbName, String tableName) throws HiveMetastoreException { try { connectIfNeeded(); return client.get_table(dbName, tableName); } catch (NoSuchObjectException e) { return null; } catch (TException e) { close(); throw new HiveMetastoreException(e); } }
@Override public Table getTable(String databaseName, String tableName) throws TException { return client.get_table(databaseName, tableName); }
@Override public Table getTable(String databaseName, String tableName) throws TException { return client.get_table(databaseName, tableName); }
@Override public Table getTable(String databaseName, String tableName) throws TException { return client.get_table(databaseName, tableName); }