How to use the plywood.basicExecutorFactory function in plywood

To help you get started, we’ve selected a few plywood examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github allegro / turnilo / src / common / models / data-cube / data-cube.ts View on Github external
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);
  }
github geo-opensource / pivot / src / server / utils / settings-manager / settings-manager.ts View on Github external
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);
    }
  }
github allegro / turnilo / src / common / models / data-cube / data-cube.ts View on Github external
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);
  }
github hortonworks / streamline / pivot / src / server / utils / settings-manager / settings-manager.ts View on Github external
return fileManager.loadDataset().then((dataset) => {
      var newExecutor = basicExecutorFactory({
        datasets: { main: dataset }
      });
      this.addExecutor(dataCube, newExecutor);
      this.addTimeCheckIfNeeded(dataCube, newExecutor);
    });
  }
github hortonworks / streamline / pivot / src / server / utils / settings-manager / settings-manager.ts View on Github external
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);
    }
  }
github geo-opensource / pivot / src / server / utils / settings-manager / settings-manager.ts View on Github external
return fileManager.loadDataset().then((dataset) => {
      var newExecutor = basicExecutorFactory({
        datasets: { main: dataset }
      });
      this.addExecutor(dataCube, newExecutor);
      this.addTimeCheckIfNeeded(dataCube, newExecutor);
    });
  }
github allegro / turnilo / src / server / routes / query / query.ts View on Github external
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' });
github allegro / turnilo / src / common / models / data-cube / data-cube.fixtures.ts View on Github external
*
 *     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: [
github allegro / turnilo / src / server / utils / data-source-loader / data-source-loader.ts View on Github external
.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);
          });
github geo-opensource / pivot / src / common / models / app-settings / app-settings.mock.ts View on Github external
static executorsWiki(): Lookup {
    return {
      wiki: basicExecutorFactory({
        datasets: {
          main: Dataset.fromJS(SMALL_WIKI_DATA)
        }
      })
    };
  }
}