expression.ts 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * Copyright (C) 2018 Centro de Computacao Cientifica e Software Livre
 * Departamento de Informatica - Universidade Federal do Parana
 *
 * This file is part of blend.
 *
 * blend is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * blend is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with blend.  If not, see <http://www.gnu.org/licenses/>.
 */

import { View } from "../core/view";

23 24 25
/**
 * Operation codes to each allowed operation over a view.
 */
26
export enum Opcode {
27 28 29 30 31 32 33
    /**
     * Push operation.
     * This operation means that the view is materialized.
     * This also means that there are no need to create it
     * using other views.
     * And also means that this view is a valid data location.
     */
34
    PUSH,
35 36 37 38 39 40
    /**
     * Join operation.
     * The view will be created using a set of others view.
     * This operation is equivalent a INNER JOIN of SQL
     * or as close as possible of JOIN.
     */
41
    JOIN,
42 43 44 45 46 47
    /**
     * Reduce operation.
     * The reduce operation removes irrelevant metrics and
     * dimensions and apply clauses. Represents the Projection
     * and Selecion operations of Relational Algebra.
     */
48 49 50
    REDUCE
}

51 52 53 54
/**
 * Defines how to construct a View with a operation
 * and a set of chidren Views.
 */
55
export interface Operation {
56
    /** Operation code used. */
57
    opcode: Opcode;
58
    /** Set of views required to perform the operation. */
59 60
    values: View[];
}