Search in sources :

Example 1 with Dimension

use of com.yahoo.elide.modelconfig.model.Dimension in project elide by yahoo.

the class DynamicConfigValidator method populateInheritance.

private void populateInheritance(Table table, Set<Table> processed) {
    if (processed.contains(table)) {
        return;
    }
    processed.add(table);
    if (!table.hasParent()) {
        return;
    }
    Table parent = table.getParent(this.elideTableConfig);
    if (!processed.contains(parent)) {
        populateInheritance(parent, processed);
    }
    Map<String, Measure> measures = getInheritedMeasures(parent, attributesListToMap(table.getMeasures()));
    table.setMeasures(new ArrayList<>(measures.values()));
    Map<String, Dimension> dimensions = getInheritedDimensions(parent, attributesListToMap(table.getDimensions()));
    table.setDimensions(new ArrayList<>(dimensions.values()));
    Map<String, Join> joins = getInheritedJoins(parent, attributesListToMap(table.getJoins()));
    table.setJoins(new ArrayList<>(joins.values()));
    String schema = getInheritedSchema(parent, table.getSchema());
    table.setSchema(schema);
    String dbConnectionName = getInheritedConnection(parent, table.getDbConnectionName());
    table.setDbConnectionName(dbConnectionName);
    String sql = getInheritedSql(parent, table.getSql());
    table.setSql(sql);
    String tableName = getInheritedTable(parent, table.getTable());
    table.setTable(tableName);
    List<Argument> arguments = getInheritedArguments(parent, table.getArguments());
    table.setArguments(arguments);
// isFact, isHidden, ReadAccess, namespace have default Values in schema, so can not be inherited.
// Other properties (tags, cardinality, etc.) have been categorized as non-inheritable too.
}
Also used : Table(com.yahoo.elide.modelconfig.model.Table) Argument(com.yahoo.elide.modelconfig.model.Argument) Measure(com.yahoo.elide.modelconfig.model.Measure) Join(com.yahoo.elide.modelconfig.model.Join) Dimension(com.yahoo.elide.modelconfig.model.Dimension)

Aggregations

Argument (com.yahoo.elide.modelconfig.model.Argument)1 Dimension (com.yahoo.elide.modelconfig.model.Dimension)1 Join (com.yahoo.elide.modelconfig.model.Join)1 Measure (com.yahoo.elide.modelconfig.model.Measure)1 Table (com.yahoo.elide.modelconfig.model.Table)1