public <T extends Dataset> T getDataset(DatasetId datasetId, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(datasetId, arguments, AccessType.UNKNOWN); }
public <T extends Dataset> T getDataset(DatasetId datasetId, Map<String, String> arguments) throws DatasetInstantiationException { return getDataset(datasetId, arguments, AccessType.UNKNOWN); }
public <T extends Dataset> T getDataset(DatasetId datasetId) throws DatasetInstantiationException { return getDataset(datasetId, DatasetDefinition.NO_ARGUMENTS); }
public <T extends Dataset> T getDataset(DatasetId datasetId) throws DatasetInstantiationException { return getDataset(datasetId, DatasetDefinition.NO_ARGUMENTS); }
public void initialize() throws IOException, DatasetManagementException, DatasetNotFoundException, ClassNotFoundException { dataset = datasetInstantiator.getDataset(datasetId); if (dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } }
public void initialize() throws IOException, DatasetManagementException, DatasetNotFoundException, ClassNotFoundException { dataset = datasetInstantiator.getDataset(datasetId); if (dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } }
private String generateEnableStatement(DatasetId datasetId, DatasetSpecification spec, boolean truncating) throws UnsupportedTypeException, ExploreException { try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) { Dataset dataset = datasetInstantiator.getDataset(datasetId); try { return generateEnableStatement(dataset, spec, datasetId, tableNaming.getTableName(datasetId, spec.getProperties()), truncating); } finally { Closeables.closeQuietly(dataset); } } catch (IOException e) { throw new ExploreException("Exception while trying to instantiate dataset " + datasetId, e); } }
private String generateEnableStatement(DatasetId datasetId, DatasetSpecification spec, boolean truncating) throws UnsupportedTypeException, ExploreException { try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) { Dataset dataset = datasetInstantiator.getDataset(datasetId); try { return generateEnableStatement(dataset, spec, datasetId, tableNaming.getTableName(datasetId, spec.getProperties()), truncating); } finally { Closeables.closeQuietly(dataset); } } catch (IOException e) { throw new ExploreException("Exception while trying to instantiate dataset " + datasetId, e); } }
Dataset dataset; try { dataset = datasetInstantiator.getDataset(datasetId); } catch (Exception e) { LOG.error("Exception instantiating dataset {}.", datasetId, e);
Dataset dataset; try { dataset = datasetInstantiator.getDataset(datasetId); } catch (Exception e) { LOG.error("Exception instantiating dataset {}.", datasetId, e);
Dataset dataset = datasetInstantiator.getDataset(datasetId); try { alterStatements = generateAlterStatements(datasetId, tableName, dataset, spec, oldSpec);
Dataset dataset = datasetInstantiator.getDataset(datasetId); try { alterStatements = generateAlterStatements(datasetId, tableName, dataset, spec, oldSpec);
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); } }
/** * Creates a new instance of a dataset based on the given information. */ private Dataset createDatasetInstance(DatasetCacheKey key, boolean recordLineage) { DatasetId datasetId = new DatasetId(key.getNamespace(), key.getName()); Dataset dataset = instantiator.getDataset(datasetId, key.getArguments(), key.getAccessType()); if (dataset instanceof MeteredDataset && metricsContext != null) { ((MeteredDataset) dataset).setMetricsCollector( metricsContext.childContext(Constants.Metrics.Tag.DATASET, key.getName())); } if (recordLineage) { instantiator.writeLineage(datasetId, key.getAccessType()); } return dataset; }
/** * Creates a new instance of a dataset based on the given information. */ private Dataset createDatasetInstance(DatasetCacheKey key, boolean recordLineage) { DatasetId datasetId = new DatasetId(key.getNamespace(), key.getName()); Dataset dataset = instantiator.getDataset(datasetId, key.getArguments(), key.getAccessType()); if (dataset instanceof MeteredDataset && metricsContext != null) { ((MeteredDataset) dataset).setMetricsCollector( metricsContext.childContext(Constants.Metrics.Tag.DATASET, key.getName())); } if (recordLineage) { instantiator.writeLineage(datasetId, key.getAccessType()); } return dataset; }
Dataset dataset = datasetInstantiator.getDataset(datasetId); if (dataset == null) { throw new SerDeException("Could not find dataset " + datasetId);
Dataset dataset = datasetInstantiator.getDataset(datasetId); if (dataset == null) { throw new SerDeException("Could not find dataset " + datasetId);