/** * Checks the name and descriptor for known compatibility issues and warns. * * <p>If the column names are not compatible across components or if any partition name duplicates * its source field name, this will warn the user. * * @param namespace a String namespace * @param name a String dataset name * @param descriptor a {@link DatasetDescriptor} */ public static void checkAndWarn(String namespace, String name, DatasetDescriptor descriptor) { try { checkDatasetName(namespace, name); checkDescriptor(descriptor); } catch (IllegalArgumentException e) { LOG.warn(e.getMessage()); } catch (IllegalStateException e) { LOG.warn(e.getMessage()); } }
@Override public DatasetDescriptor update(String name, DatasetDescriptor descriptor) { Compatibility.checkDatasetName(name); Compatibility.checkDescriptor(descriptor); if (!exists(name)) { throw new DatasetNotFoundException("Table not found: " + name); } Table table = getHcat().getTable(HiveUtils.DEFAULT_DB, name); HiveUtils.updateTableSchema(table, descriptor); getHcat().alterTable(table); return descriptor; }