public LoadableDataSource(Dataset targetDataset, IAType itemType, IAType metaItemType, String adapter,
Map<String, String> properties) throws AlgebricksException, IOException {
super(new DataSourceId("loadable_dv", "loadable_ds"), itemType, metaItemType, Type.LOADABLE, null);
this.targetDataset = targetDataset;
this.adapter = adapter;
this.adapterProperties = properties;
partitioningKeys = targetDataset.getPrimaryKeys();
ARecordType recType = (ARecordType) itemType;
isPKAutoGenerated = ((InternalDatasetDetails) targetDataset.getDatasetDetails()).isAutogenerated();
if (isPKAutoGenerated) {
recType = getStrippedPKType(new LinkedList<>(partitioningKeys.get(0)), recType);
}
schemaTypes = new IAType[] { recType };
}