if (FileSetProperties.isExploreEnabled(properties)) { if (FileSetProperties.isUseExisting(spec.getProperties())) { return null;
if (FileSetProperties.isExploreEnabled(properties)) { if (FileSetProperties.isUseExisting(spec.getProperties())) { return null;
FileSetAdmin(DatasetContext datasetContext, CConfiguration cConf, LocationFactory locationFactory, NamespacePathLocator namespacePathLocator, DatasetSpecification spec) throws IOException { this.spec = spec; this.isExternal = FileSetProperties.isDataExternal(spec.getProperties()); this.useExisting = FileSetProperties.isUseExisting(spec.getProperties()); this.possessExisting = FileSetProperties.isPossessExisting(spec.getProperties()); this.baseLocation = FileSetDataset.determineBaseLocation(datasetContext, cConf, spec, locationFactory, namespacePathLocator); this.datasetContext = datasetContext; this.cConf = cConf; this.locationFactory = locationFactory; this.namespacePathLocator = namespacePathLocator; }
FileSetAdmin(DatasetContext datasetContext, CConfiguration cConf, LocationFactory locationFactory, NamespacedLocationFactory namespacedLocationFactory, DatasetSpecification spec) throws IOException { this.spec = spec; this.isExternal = FileSetProperties.isDataExternal(spec.getProperties()); this.useExisting = FileSetProperties.isUseExisting(spec.getProperties()); this.possessExisting = FileSetProperties.isPossessExisting(spec.getProperties()); this.baseLocation = FileSetDataset.determineBaseLocation(datasetContext, cConf, spec, locationFactory, namespacedLocationFactory); this.datasetContext = datasetContext; this.cConf = cConf; this.locationFactory = locationFactory; this.namespacedLocationFactory = namespacedLocationFactory; }
private String generateDisableStatement(DatasetId datasetId, DatasetSpecification spec) throws ExploreException { String tableName = tableNaming.getTableName(datasetId, spec.getProperties()); String databaseName = ExploreProperties.getExploreDatabaseName(spec.getProperties()); // If table does not exist, nothing to be done try { exploreService.getTableInfo(datasetId.getNamespace(), databaseName, tableName); } catch (TableNotFoundException e) { // Ignore exception, since this means table was not found. return null; } try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) { Dataset dataset = datasetInstantiator.getDataset(datasetId); try { if (dataset instanceof FileSet || dataset instanceof PartitionedFileSet) { // do not drop the explore table that dataset is reusing an existing table if (FileSetProperties.isUseExisting(spec.getProperties())) { return null; } } return generateDeleteStatement(dataset, databaseName, tableName); } finally { Closeables.closeQuietly(dataset); } } catch (IOException e) { LOG.error("Exception creating dataset classLoaderProvider for dataset {}.", datasetId, e); throw new ExploreException("Exception instantiating dataset " + datasetId); } }
private String generateDisableStatement(DatasetId datasetId, DatasetSpecification spec) throws ExploreException { String tableName = tableNaming.getTableName(datasetId, spec.getProperties()); String databaseName = ExploreProperties.getExploreDatabaseName(spec.getProperties()); // If table does not exist, nothing to be done try { exploreService.getTableInfo(datasetId.getNamespace(), databaseName, tableName); } catch (TableNotFoundException e) { // Ignore exception, since this means table was not found. return null; } try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) { Dataset dataset = datasetInstantiator.getDataset(datasetId); try { if (dataset instanceof FileSet || dataset instanceof PartitionedFileSet) { // do not drop the explore table that dataset is reusing an existing table if (FileSetProperties.isUseExisting(spec.getProperties())) { return null; } } return generateDeleteStatement(dataset, databaseName, tableName); } finally { Closeables.closeQuietly(dataset); } } catch (IOException e) { LOG.error("Exception creating dataset classLoaderProvider for dataset {}.", datasetId, e); throw new ExploreException("Exception instantiating dataset " + datasetId); } }
if (FileSetProperties.isUseExisting(tableProperties) || (FileSetProperties.isPossessExisting(tableProperties) && !truncating)) { try {
if (FileSetProperties.isUseExisting(tableProperties) || (FileSetProperties.isPossessExisting(tableProperties) && !truncating)) { try {