Source:
<code>public DatasetDescriptor create(String namespace, String name, DatasetDescriptor descriptor) { Compatibility.checkDatasetName(namespace, name); Compatibility.checkDescriptor(descriptor); String resolved = resolveNamespace( namespace, name, descriptor.getLocation()); if (resolved != null) { if (resolved.equals(namespace)) { throw new DatasetExistsException( "Metadata already exists for dataset: " + namespace + "." + name); } else { LOG.warn("Creating table {}.{} for {}: replaces default.{}", new Object[]{ namespace, name, pathForDataset(namespace, name), name}); Compatibility.checkUpdate(load(resolved, name), descriptor); } } LOG.info("Creating an external Hive table: {}.{}", namespace, name); DatasetDescriptor newDescriptor = descriptor; if (descriptor.getLocation() == null) { newDescriptor = new DatasetDescriptor.Builder(descriptor) .location(pathForDataset(namespace, name)) .build(); } if (descriptor.getSchemaUrl() == null) { Path managerPath = new Path(new Path(newDescriptor.getLocation()), <START> SCHEMA_DIRECTORY); <END> SchemaManager manager = SchemaManager.create(conf, managerPath); URI schemaUri = manager.writeSchema(descriptor.getSchema()); try { newDescriptor = new DatasetDescriptor.Builder(newDescriptor) .schemaUri(schemaUri) .build(); } catch (IOException e) { throw new DatasetIOException("Unable to load schema", e); } } FileSystemUtil.ensureLocationExists(newDescriptor, conf); Table table = HiveUtils.tableForDescriptor( namespace, name, newDescriptor, true ); getMetaStoreUtil().createTable(table); return newDescriptor; }</code><technical_language>this create a SchemaManager? If URL is in manager a good (is case detected?). Otherwise, right do is copy Schema a managed location rely one. addresses concern schema is changed Kite (since Kite currently a pointer)</technical_language>

Target:
public DatasetDescriptor create(String namespace, String name, DatasetDescriptor descriptor) { Compatibility.checkDatasetName(namespace, name); Compatibility.checkDescriptor(descriptor); String resolved = resolveNamespace( namespace, name, descriptor.getLocation()); if (resolved != null) { if (resolved.equals(namespace)) { throw new DatasetExistsException( "Metadata already exists for dataset: " + namespace + "." + name); } else { LOG.warn("Creating table {}.{} for {}: replaces default.{}", new Object[]{ namespace, name, pathForDataset(namespace, name), name}); Compatibility.checkUpdate(load(resolved, name), descriptor); } } LOG.info("Creating an external Hive table: {}.{}", namespace, name); DatasetDescriptor newDescriptor = descriptor; if (descriptor.getLocation() == null) { newDescriptor = new DatasetDescriptor.Builder(descriptor) .location(pathForDataset(namespace, name)) .build(); } Path managerPath = new Path(new Path(newDescriptor.getLocation()), SCHEMA_DIRECTORY); SchemaManager manager = SchemaManager.create(conf, managerPath); URI managedSchemaUri = manager.writeSchema(descriptor.getSchema()); try { newDescriptor = new DatasetDescriptor.Builder(newDescriptor) .schemaUri(managedSchemaUri) .build(); } catch (IOException e) { throw new DatasetIOException("Unable to load schema", e); } FileSystemUtil.ensureLocationExists(newDescriptor, conf); Table table = HiveUtils.tableForDescriptor( namespace, name, newDescriptor, true ); getMetaStoreUtil().createTable(table); return newDescriptor; }