Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public updateWithExternal(external: External): DataCube {
if (this.clusterName === "native") throw new Error("can not be native and have an external");
const executor = basicExecutorFactory({
datasets: { main: external }
});
return this.addAttributes(external.attributes).attachExecutor(executor);
}
private addClusterCube(dataCube: DataCube): void {
var clusterManager = this.getClusterManagerFor(dataCube.clusterName);
if (clusterManager) {
var newExecutor = basicExecutorFactory({
datasets: { main: dataCube.toExternal(clusterManager.cluster, clusterManager.requester) }
});
this.addExecutor(dataCube, newExecutor);
this.addTimeCheckIfNeeded(dataCube, newExecutor);
}
}
public updateWithDataset(dataset: Dataset): DataCube {
if (this.clusterName !== "native") throw new Error("must be native to have a dataset");
const executor = basicExecutorFactory({
datasets: { main: dataset }
});
return this.addAttributes(dataset.attributes).attachExecutor(executor);
}
return fileManager.loadDataset().then((dataset) => {
var newExecutor = basicExecutorFactory({
datasets: { main: dataset }
});
this.addExecutor(dataCube, newExecutor);
this.addTimeCheckIfNeeded(dataCube, newExecutor);
});
}
private addClusterCube(dataCube: DataCube): void {
var clusterManager = this.getClusterManagerFor(dataCube.clusterName);
if (clusterManager) {
var newExecutor = basicExecutorFactory({
datasets: { main: dataCube.toExternal(clusterManager.cluster, clusterManager.requester) }
});
this.addExecutor(dataCube, newExecutor);
this.addTimeCheckIfNeeded(dataCube, newExecutor);
}
}
return fileManager.loadDataset().then((dataset) => {
var newExecutor = basicExecutorFactory({
datasets: { main: dataset }
});
this.addExecutor(dataCube, newExecutor);
this.addTimeCheckIfNeeded(dataCube, newExecutor);
});
}
context: null,
attributes,
requester: druidRequester
});
}
var executors: Lookup = {};
for (var dataSource of DATA_SOURCES) {
if (dataSource.source) {
executors[dataSource.name] = basicExecutorFactory({
datasets: { main: makeExternal(dataSource) }
});
} else {
var wikiDataset = Dataset.fromJS(getWikiData()).hide();
executors[dataSource.name] = basicExecutorFactory({
datasets: { main: wikiDataset }
});
}
}
router.post('/', (req: Request, res: Response) => {
var { dataset, expression } = req.body;
if (typeof dataset !== 'string') {
res.status(400).send({ error: 'must have a string dataset' });
return;
}
var executor = executors[dataset];
if (!executor) {
res.status(400).send({ error: 'unknown dataset' });
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { basicExecutorFactory, Dataset } from "plywood";
import { DimensionsFixtures } from "../dimension/dimensions.fixtures";
import { MeasuresFixtures } from "../measure/measures.fixtures";
import { DataCube, DataCubeJS } from "./data-cube";
var executor = basicExecutorFactory({
datasets: {
wiki: Dataset.fromJS([]),
twitter: Dataset.fromJS([])
}
});
export class DataCubeFixtures {
public static get WIKI_JS(): DataCubeJS {
return {
name: "wiki",
title: "Wiki",
description: "Wiki full description something about articles and editors",
clusterName: "druid-wiki",
source: "wiki",
introspection: "none",
attributes: [
.then((rawData) => {
var dataset = Dataset.fromJS(rawData).hide();
if (dataSource.subsetFilter) {
dataset = dataset.filter(dataSource.subsetFilter.getFn(), {});
}
var executor = basicExecutorFactory({
datasets: { main: dataset }
});
return dataSource.addAttributes(dataset.attributes).attachExecutor(executor);
});
static executorsWiki(): Lookup {
return {
wiki: basicExecutorFactory({
datasets: {
main: Dataset.fromJS(SMALL_WIKI_DATA)
}
})
};
}
}